/* SDML Pay — Feuille de style principale */
:root {
    --primary:    #1a56db;
    --primary-dk: #1344b8;
    --success:    #057a55;
    --warning:    #b45309;
    --danger:     #c81e1e;
    --bg:         #f9fafb;
    --card-bg:    #ffffff;
    --border:     #e5e7eb;
    --text:       #111827;
    --muted:      #6b7280;
    --radius:     8px;
    --shadow:     0 1px 3px rgba(0,0,0,.08);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
    background: var(--primary);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    box-shadow: 0 2px 4px rgba(0,0,0,.12);
}
.navbar-admin { background: #1e293b; }
.nav-brand { color: #fff; font-weight: 700; font-size: 18px; text-decoration: none; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
    color: rgba(255,255,255,.85);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    transition: background .15s;
}
.nav-links a:hover { background: rgba(255,255,255,.15); color: #fff; }
.nav-logout { color: rgba(255,255,255,.65) !important; }

/* ── Container ──────────────────────────────────────────── */
.container { max-width: 1100px; margin: 32px auto; padding: 0 20px; }
h2 { font-size: 22px; font-weight: 700; margin-bottom: 20px; }
h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

/* ── Cards ──────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

/* ── Stats grid ─────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--shadow);
}
.stat-label  { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.stat-value  { font-size: 22px; font-weight: 700; }
.stat-alert  { border-color: #f59e0b; background: #fffbeb; }
.stat-link   { font-size: 12px; color: var(--primary); text-decoration: none; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: opacity .15s, background .15s;
}
.btn:hover { opacity: .88; }
.btn-primary   { background: var(--primary);  color: #fff; }
.btn-secondary { background: #4b5563; color: #fff; }
.btn-success   { background: var(--success); color: #fff; }
.btn-danger    { background: var(--danger);  color: #fff; }
.btn-warning   { background: #d97706; color: #fff; }
.btn-sm, .btn-xs { padding: 4px 10px; font-size: 12px; }
.btn-block     { width: 100%; justify-content: center; }
.btn-whatsapp  { background: #25d366; color: #fff; }
.btn:disabled  { opacity: .5; cursor: not-allowed; }

/* ── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 5px; font-size: 13px; }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: #fff;
    transition: border .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,.1);
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.form-check label { display: flex; align-items: center; gap: 8px; cursor: pointer; margin-bottom: 12px; }

/* ── Tables ─────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--border); font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #f8faff; }

/* ── Alerts ─────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; }
.alert p { margin: 4px 0; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #14532d; }
.alert-danger  { background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #78350f; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; }

/* ── Status badges ──────────────────────────────────────── */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.status-success    { background: #dcfce7; color: #14532d; }
.status-pending    { background: #fef9c3; color: #713f12; }
.status-failed     { background: #fee2e2; color: #7f1d1d; }
.status-abandoned  { background: #f3f4f6; color: #374151; }
.status-processing { background: #dbeafe; color: #1e3a8a; }

.kyc-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.kyc-none     { background: #f3f4f6; color: #374151; }
.kyc-pending  { background: #fef9c3; color: #713f12; }
.kyc-approved { background: #dcfce7; color: #14532d; }
.kyc-rejected { background: #fee2e2; color: #7f1d1d; }

/* ── Auth pages ─────────────────────────────────────────── */
.auth-page   { background: #f3f4f6; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-card   { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 36px; width: 100%; max-width: 420px; box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.auth-logo   { text-align: center; margin-bottom: 28px; }
.auth-logo h1 { font-size: 28px; color: var(--primary); }
.auth-logo p  { color: var(--muted); font-size: 14px; margin-top: 4px; }
.auth-footer  { text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); }

/* ── Payment links ──────────────────────────────────────── */
.links-list { display: flex; flex-direction: column; gap: 12px; }
.link-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.link-card.inactive { opacity: .55; }
.link-info { margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.link-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.link-url { flex: 1; min-width: 200px; font-size: 12px; color: var(--muted); background: #f9fafb; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; background: #dbeafe; color: #1e3a8a; }
.badge-outline { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.badge-danger  { background: #fee2e2; color: #7f1d1d; }

/* ── Pagination ─────────────────────────────────────────── */
.pagination { display: flex; gap: 4px; padding: 16px 0 0; }
.pagination a { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; text-decoration: none; color: var(--text); }
.pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Misc ────────────────────────────────────────────────── */
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger  { color: var(--danger)  !important; }
.text-muted   { color: var(--muted)   !important; }
.empty-state  { text-align: center; color: var(--muted); padding: 32px; }
.search-bar   { display: flex; gap: 8px; margin-bottom: 16px; }
.search-bar input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar input, .filter-bar select { padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); }
.totals-bar { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: var(--radius); padding: 10px 16px; margin-bottom: 12px; font-size: 13px; }
.small, small { font-size: 12px; }
.d-block { display: block; }
code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-family: monospace; font-size: 12px; }

/* ── KYC card ────────────────────────────────────────────── */
.kyc-card { margin-bottom: 16px; }
.kyc-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.kyc-doc { margin: 12px 0; }
.kyc-doc-preview { border: 1px solid var(--border); border-radius: var(--radius); }
.kyc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
