/* =========================================================
   FirstLink Dashboard — Unified Stylesheet
   ========================================================= */

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

html, body {
    height: 100%;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #e0e0e0;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ---- Nav ---- */
nav {
    background: rgba(0,0,0,0.4);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(6px);
}
.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    max-width: 1400px;
    margin: 0 auto;
}
.nav-brand {
    font-size: 18px;
    font-weight: 700;
    color: #7ec8e3;
    letter-spacing: 1px;
}
.nav-links { display: flex; gap: 8px; }

/* ---- Page wrap ---- */
.page-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 20px 40px;
}
.page-header { margin-bottom: 20px; }
.page-header h2 { font-size: 22px; font-weight: 600; color: #fff; margin-bottom: 14px; }

/* ---- Stats row ---- */
.stats-row { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 12px 20px;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: #aaa; }
.stat-value  { font-size: 20px; font-weight: 700; color: #7ec8e3; }

/* ---- Action row ---- */
.action-row { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }

/* ---- Buttons ---- */
button, .btn-primary, .btn-secondary, .btn-danger, .btn-nav,
.btn-success, .btn-export, .btn-xs, .btn-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: opacity 0.15s, transform 0.1s;
    white-space: nowrap;
}
button:hover  { opacity: 0.85; transform: translateY(-1px); }
button:active { transform: translateY(0); }

.btn-primary  { background: #2563eb; color: #fff; }
.btn-secondary{ background: rgba(255,255,255,0.12); color: #e0e0e0; border: 1px solid rgba(255,255,255,0.15); }
.btn-danger   { background: #dc2626; color: #fff; }
.btn-success  { background: #16a34a; color: #fff; }
.btn-export   { background: #7c3aed; color: #fff; }
.btn-nav      { background: rgba(255,255,255,0.1); color: #e0e0e0; padding: 6px 14px; font-size: 13px; }
.btn-nav:hover{ background: rgba(255,255,255,0.18); }
.btn-xs       { padding: 4px 10px; font-size: 12px; border-radius: 4px; background: #2563eb; color: #fff; }
.btn-copy     { background: rgba(255,255,255,0.12); color: #e0e0e0; }
.full-width   { width: 100%; }

/* ---- Table ---- */
.table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255,255,255,0.04);
}
thead th {
    background: rgba(37,99,235,0.3);
    color: #c0d8ff;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 11px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    white-space: nowrap;
}
tbody td {
    padding: 9px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    vertical-align: middle;
}
tbody tr:hover td { background: rgba(255,255,255,0.04); }
tbody tr:last-child td { border-bottom: none; }

.mono    { font-family: 'Courier New', monospace; font-size: 12px; }
.small   { font-size: 12px; }
.muted   { color: #888; }
.center  { text-align: center; }
.amount  { font-weight: 600; color: #4ade80; }
.loading { color: #888; font-style: italic; }

/* ---- Inline form (nickname + payout) ---- */
.inline-form {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}
.input-sm {
    padding: 4px 8px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 12px;
    width: 110px;
}
.input-amount { width: 80px; }
.input-sm::placeholder { color: #888; }
.input-sm:focus { outline: none; border-color: #2563eb; background: rgba(255,255,255,0.12); }

/* ---- Alerts ---- */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success { background: rgba(22,163,74,0.2);  border: 1px solid #16a34a; color: #86efac; }
.alert-error   { background: rgba(220,38,38,0.2);   border: 1px solid #dc2626; color: #fca5a5; }

/* ---- Badge (status) ---- */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}
.badge-success { background: rgba(22,163,74,0.25);  color: #86efac; }
.badge-error   { background: rgba(220,38,38,0.25);  color: #fca5a5; }
.badge-pending { background: rgba(234,179,8,0.25);  color: #fde68a; }

/* ---- Filters ---- */
.filter-form  { margin-bottom: 16px; }
.filter-row   { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: #aaa; }
.filter-group input,
.filter-group select {
    padding: 7px 10px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    background: rgba(255,255,255,0.07);
    color: #e0e0e0;
    font-size: 13px;
    min-width: 130px;
}
.filter-group input:focus,
.filter-group select:focus { outline: none; border-color: #2563eb; }
.filter-group select option { background: #1a1a2e; color: #e0e0e0; }
.filter-search input { min-width: 200px; }
.filter-actions { display: flex; gap: 8px; align-items: flex-end; }

/* ---- Pagination ---- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
    color: #e0e0e0;
    font-size: 13px;
    transition: background 0.15s;
}
.page-btn:hover   { background: rgba(255,255,255,0.16); }
.page-btn.active  { background: #2563eb; color: #fff; font-weight: 700; }
.page-btn[href*="Prev"],
.page-btn[href*="Next"] { width: auto; padding: 0 12px; }

/* ---- Nav dropdown ---- */
.nav-dropdown { position: relative; display: inline-block; }
.nav-dropdown-menu {
    display: none;
    position: fixed;
    top: 52px;
    background: #0f1a30;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    min-width: 170px;
    z-index: 9999;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.nav-dropdown-menu.open { display: block; }
.nav-dropdown-menu a {
    display: block;
    padding: 11px 18px;
    color: #e0e0e0;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s;
    white-space: nowrap;
}
.nav-dropdown-menu a:last-child { border-bottom: none; }
.nav-dropdown-menu a:hover { background: rgba(37,99,235,0.25); color: #7ec8e3; }
.btn-nav-active { background: rgba(37,99,235,0.3) !important; color: #7ec8e3 !important; }

/* ---- GP colour helpers ---- */
.gp-green { color: #4ade80; }
.gp-red   { color: #f87171; }
.gp-amber { color: #fbbf24; }
.fa-id    { margin-top: 4px; }

/* ---- Auth (Login) ---- */
.auth-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}
.auth-box {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 36px 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.auth-box h2 {
    text-align: center;
    font-size: 20px;
    color: #7ec8e3;
    margin-bottom: 24px;
    font-weight: 700;
    letter-spacing: 1px;
}
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.form-group label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: #aaa; }
.form-group input {
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    background: rgba(255,255,255,0.07);
    color: #e0e0e0;
    font-size: 14px;
    transition: border-color 0.15s;
}
.form-group input:focus  { outline: none; border-color: #2563eb; background: rgba(255,255,255,0.1); }
.btn-primary.full-width  { margin-top: 8px; padding: 11px; font-size: 15px; }
