/**
 * GlobalCoin — Global Styles
 * File: assets/css/main.css
 *
 * Shared styles that apply to ALL clients. Layout & chrome live in
 * config/{client}/theme.css. This file carries a few cross-client
 * utilities + scrollbar + animations.
 */

/* ─── Scrollbar ────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ─── Status colour utilities ──────────── */
.text-accent     { color: var(--app-accent) !important; }
.bg-accent       { background: var(--app-accent) !important; color: #fff; }
.bg-accent-light { background: var(--app-accent-light) !important; }

.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fs-12  { font-size: .75rem  !important; }
.fs-13  { font-size: .8125rem !important; }

/* ─── Status badges ─────────────────────── */
.badge-success { background: #16a34a; color: #fff; }
.badge-danger  { background: #dc2626; color: #fff; }
.badge-warning { background: #ca8a04; color: #fff; }
.badge-info    { background: #0284c7; color: #fff; }

/* KYC status pills */
.kyc-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
}
.kyc-pill.none      { background: #f1f5f9; color: #64748b; }
.kyc-pill.submitted { background: #dbeafe; color: #1d4ed8; }
.kyc-pill.approved  { background: #dcfce7; color: #166534; }
.kyc-pill.rejected  { background: #fee2e2; color: #991b1b; }

/* ─── Upload zone (KYC forms etc) ──────── */
.upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    padding: 1.75rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all .18s ease;
    background: #fafafa;
}
.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--app-accent);
    background: var(--app-accent-light);
    color: var(--app-accent);
}
.upload-zone .bi { font-size: 1.6rem; color: #9ca3af; }

/* ─── Toast ─────────────────────────────── */
#appToast                { min-width: 280px; }
#appToast.bg-success     { background: #16a34a !important; }
#appToast.bg-danger      { background: #dc2626 !important; }
#appToast.bg-warning     { background: #ca8a04 !important; }
#appToast.bg-info        { background: #0284c7 !important; }

/* ─── Animations ────────────────────────── */
.fade-in {
    animation: fadeIn .3s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Soft pill buttons ─────────────────────────────────────────────
 * Low-contrast, friendly button family used across admin tables for
 * status pills, row actions, and add/edit/delete affordances. Same
 * shape + spacing as Bootstrap btn but with a tinted background and
 * matching foreground colour — easier on the eye than solid colours
 * and clearer than outline buttons in dense tables.
 *
 * Usage:
 *   <button class="btn-soft btn-soft-success">…</button>
 *   <button class="btn-soft btn-soft-secondary">…</button>
 *   <button class="btn-soft btn-soft-danger">…</button>
 *
 * Pair `.btn-soft` with the size modifier (.btn-sm if you want, though
 * .btn-soft already runs slightly smaller than the default Bootstrap btn).
 */
.btn-soft {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .85rem;
    border-radius: 999px;          /* full pill */
    border: 1px solid transparent;
    font-size: .82rem;
    font-weight: 500;
    line-height: 1.2;
    transition: background-color .15s, color .15s, box-shadow .15s, transform .05s;
    cursor: pointer;
    text-decoration: none;
}
.btn-soft:hover    { box-shadow: 0 1px 0 rgba(0,0,0,.04); }
.btn-soft:active   { transform: translateY(1px); }
.btn-soft:disabled { opacity: .55; cursor: not-allowed; }

/* Icon-only pill (square, same radius). Useful for edit/delete row actions. */
.btn-soft-icon {
    padding: .35rem .55rem;
    gap: 0;
}

/* Variants — each has a base tint, hover deepens by ~6%. */
.btn-soft-primary   { background: #e7f0ff; color: #1d4ed8; }
.btn-soft-primary:hover   { background: #d6e4ff; color: #1d4ed8; }
.btn-soft-success   { background: #dcfce7; color: #166534; }
.btn-soft-success:hover   { background: #c8f4d4; color: #166534; }
.btn-soft-danger    { background: #fee2e2; color: #991b1b; }
.btn-soft-danger:hover    { background: #fbcfcf; color: #991b1b; }
.btn-soft-warning   { background: #fef3c7; color: #92400e; }
.btn-soft-warning:hover   { background: #fce6a3; color: #92400e; }
.btn-soft-info      { background: #dbeafe; color: #1e40af; }
.btn-soft-info:hover      { background: #c7d8f5; color: #1e40af; }
.btn-soft-secondary { background: #eef2f7; color: #475569; }
.btn-soft-secondary:hover { background: #dde4ee; color: #334155; }
.btn-soft-light     { background: #f8fafc; color: #475569; border-color: #e2e8f0; }
.btn-soft-light:hover     { background: #eef2f7; }

/* Primary action-bar modifier — a touch larger than the table-row pills so
 * the dashboard's headline actions (My Customers / Send / Retrieve / …) carry
 * more weight while staying in the same soft family. */
.gc-act-btn { padding: .5rem 1.05rem; font-size: .9rem; font-weight: 600; }

/* ── Native <select> option list ──────────────────────────────────────
 * When a <select> carries a custom background (our themed .form-select),
 * Firefox paints EVERY <option> with the control's background, so the whole
 * list reads as "selected/highlighted". Pinning explicit option colours keeps
 * unselected rows plain and tints only the chosen one — on both dashboards
 * and everywhere else a themed select is used. */
select.form-select option,
.form-select option {
    background-color: #ffffff;
    color: #1f2937;
}
select.form-select option:checked,
.form-select option:checked {
    background-color: #e7f0ff;
    color: #1d4ed8;
    font-weight: 600;
}

/* "Active" toggle pill — green soft button with a gear icon — that
 * doubles as a status indicator. Click to toggle. */
.btn-soft.is-toggle .bi-gear,
.btn-soft.is-toggle .bi-circle,
.btn-soft.is-toggle .bi-check-circle-fill { font-size: .9em; }

/* ─── Empty State ────────────────────────── */
/* Strip padding from the td so the inner flex-div owns the height */
.gc-empty-cell {
    padding: 0 !important;
    border-bottom: 0 !important;
}
/* Inner flex container — centres icon + text in 200 px */
.gc-empty-cell > .gc-empty-inner,
.gc-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    text-align: center;
    color: #6c757d;
}

/* Empty-state icon centering fix.
   A Bootstrap-Icons font <i> forced to display:block hugs the LEFT inside a
   text-align:center container — text-align only moves inline content, never a
   block-level box, so the block <i> shrink-wraps and sticks to the left edge.
   (The flex .gc-empty-state above escapes this via align-items:center; the many
   lighter empty states that use the `text-center + d-block` pattern — dashboard,
   wallet, my-customers, my-tree, package cards, etc. — did not.) Giving the
   block icon fit-content width + auto side margins truly centres it everywhere
   the pattern is used, in ONE place. Also covers a custom-SVG-swapped .app-icon
   that inherits d-block from the original <i>. */
.text-center > .bi.d-block,
.text-center > .app-icon.d-block,
.text-center > svg.d-block {
    width: -moz-fit-content;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

/* ── Role pills — unified industrial slate palette (was a rainbow) ─────
 * One hue family; the shade tracks seniority so the hierarchy still scans.
 * Defined ONCE here (main.css loads on every admin + customer page) so the
 * customers list, the edit-customer hierarchy tree, and my-tree all match —
 * no per-page copies to keep in sync. */
.gc-role-company, .gc-role-sd, .gc-role-dist, .gc-role-retailer,
.gc-role-referral, .gc-role-customer, .gc-role-api {
    font-weight: 600 !important;
    border: 1px solid rgba(15, 23, 42, .06) !important;
}
.gc-role-company  { background:#334155 !important; color:#fff     !important; } /* Grand Distributor */
.gc-role-sd       { background:#475569 !important; color:#fff     !important; } /* Super Distributor */
.gc-role-dist     { background:#586b85 !important; color:#fff     !important; } /* Distributor */
.gc-role-retailer { background:#6b7d97 !important; color:#fff     !important; } /* Retailer */
.gc-role-referral { background:#7e8ba0 !important; color:#fff     !important; } /* Referral */
.gc-role-customer { background:#9aa7ba !important; color:#16202e  !important; } /* Customer */
.gc-role-api      { background:#64748b !important; color:#fff     !important; } /* API roles */
