* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #6d5bf6, #8f7bff);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
}

.auth-card {
    background: #fff;
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.admin-login-link { display:block; text-align:right; margin:0 0 10px; font-size:13px; color:#2563eb; text-decoration:none; }

.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-brand h1 { margin: 0 0 4px; color: #5b3df5; font-size: 28px; }
.muted { color: #888; font-size: 13px; margin: 0; }

.tabs {
    display: flex;
    background: #f2f1fb;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 6px;
    font-size: 13px;
    font-weight: 600;
    color: #777;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: #5b3df5;
    color: #fff;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e2e0f5;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border 0.2s ease;
}

.form-group input:focus { border-color: #5b3df5; }

.btn-primary {
    width: 100%;
    background: #5b3df5;
    color: #fff;
    border: none;
    padding: 13px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-primary:hover { background: #4a2fe0; }
.btn-primary:disabled { background: #b3a8fb; cursor: not-allowed; }

.btn-link {
    width: 100%;
    background: none;
    border: none;
    color: #5b3df5;
    font-size: 13px;
    margin-top: 10px;
    cursor: pointer;
    text-decoration: underline;
}

.hidden { display: none !important; }

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.alert.success { background: #e6f8ee; color: #1e8a4c; border: 1px solid #b5e8cb; }
.alert.error   { background: #fdeaea; color: #c62828; border: 1px solid #f6c1c1; }

/* Link between login and forgot password from within the login panel */
.forgot-link {
    text-align: right;
    display: block;
    margin: -8px 0 16px;
    font-size: 12px;
}

/* ---------------- Dashboard ---------------- */
.dashboard-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
}

.dashboard-card {
    background: #fff;
    width: 98%;
    /* max-width: 1200px; */
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.dashboard-header h1 { margin: 0 0 4px; font-size: 22px; color: #333; }

.btn-logout {
    background: #f4f4f4;
    color: #333;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.btn-logout:hover { background: #ebebeb; }

.dashboard-body p { color: #555; line-height: 1.6; }

/* ---------------- Wallet Card ---------------- */
.wallet-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #5b3df5, #8f7bff);
    border-radius: 14px;
    padding: 22px 26px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 14px;
}

.wallet-info { display: flex; flex-direction: column; gap: 4px; }
.wallet-label { color: #e7e3ff; font-size: 13px; font-weight: 600; }
.wallet-amount { color: #fff; font-size: 30px; font-weight: 700; }
.wallet-amount small { font-size: 14px; font-weight: 500; }
.wallet-rate { color: #e7e3ff !important; font-size: 12px; }

.btn-add-balance {
    width: auto;
    padding: 12px 22px;
    background: #fff;
    color: #5b3df5;
    white-space: nowrap;
}
.btn-add-balance:hover { background: #f0edff; }

/* ---------------- Sections ---------------- */
.section { margin-bottom: 30px; }
.section-title {
    font-size: 16px;
    color: #333;
    margin: 0 0 14px;
    border-left: 4px solid #5b3df5;
    padding-left: 10px;
}

/* ---------------- Tools grid ---------------- */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 14px;
}

.tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f7f6ff;
    border: 1.5px solid #eae7fb;
    border-radius: 12px;
    padding: 18px 10px;
    text-decoration: none;
    color: #444;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
}

.tool-card:hover {
    border-color: #5b3df5;
    background: #f0edff;
    transform: translateY(-2px);
}

.tool-icon { font-size: 26px; }

/* ---------------- Transaction table ---------------- */
.txn-table-wrap { overflow-x: auto; }

.txn-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.txn-table th, .txn-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

.txn-table th {
    color: #888;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}

.txn-tokens.txn-credit { color: #1e8a4c; font-weight: 700; }
.txn-tokens.txn-debit { color: #c62828; font-weight: 700; }

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}
.status-success { background: #e6f8ee; color: #1e8a4c; }
.status-pending { background: #fff6e0; color: #b8860b; }
.status-failed  { background: #fdeaea; color: #c62828; }

/* ---------------- Add Balance Modal ---------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.modal-overlay.hidden { display: none; }

.modal-box {
    background: #fff;
    border-radius: 14px;
    padding: 28px;
    width: 100%;
    max-width: 380px;
    position: relative;
}

.modal-box h3 { margin: 0 0 4px; color: #333; }

.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}
.modal-close:hover { color: #333; }

/* Tool placeholder pages */
.tool-placeholder {
    text-align: center;
    padding: 40px 20px;
}
.tool-placeholder .icon { font-size: 48px; margin-bottom: 10px; }
.back-link {
    display: inline-block;
    margin-top: 20px;
    color: #5b3df5;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}
