/* Billeo — thème mobile-first inspiré de l'app iOS "Invoices".
   CSS statique, aucun build. Chargé après Bootstrap 5 (CDN). */

:root {
    --bl-primary: #5b4be8;
    --bl-primary-dark: #4a37d0;
    --bl-primary-600: #4c3ce0;
    --bl-success: #12b76a;
    --bl-warning: #f79009;
    --bl-danger: #f04438;
    --bl-info: #2e90fa;
    --bl-bg: #f4f5f9;
    --bl-card: #ffffff;
    --bl-ink: #1a1a2e;
    --bl-muted: #8a8fa3;
    --bl-line: #eceef3;
    --bl-radius: 18px;
    --bl-radius-sm: 12px;
    --bl-shadow: 0 2px 12px rgba(24, 26, 42, 0.06);
    --bl-shadow-lg: 0 8px 28px rgba(24, 26, 42, 0.10);
}

* { -webkit-tap-highlight-color: transparent; }

body {
    background: var(--bl-bg);
    color: var(--bl-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
    -webkit-font-smoothing: antialiased;
}

/* Constrain to a phone-ish column, centered on desktop */
.bl-app {
    max-width: 520px;
    margin-inline: auto;
    padding: 16px 16px 8px;
}

/* ---------- Top bar ---------- */
.bl-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px 16px;
}
.bl-topbar h1 { font-size: 20px; font-weight: 800; margin: 0; }
.bl-iconbtn {
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: #fff; color: var(--bl-ink);
    border: 1px solid var(--bl-line);
    box-shadow: var(--bl-shadow);
    text-decoration: none;
}

/* ---------- Cards ---------- */
.bl-card {
    background: var(--bl-card);
    border-radius: var(--bl-radius);
    box-shadow: var(--bl-shadow);
    padding: 18px;
    margin-bottom: 14px;
}
.bl-card-flush { padding: 0; overflow: hidden; }

/* ---------- Revenue hero (uses the company brand colour) ---------- */
.bl-hero {
    background: var(--bl-primary); /* fallback if color-mix is unsupported */
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--bl-primary) 85%, white) 0%,
        var(--bl-primary) 55%,
        color-mix(in srgb, var(--bl-primary) 82%, black) 100%);
    color: #fff;
    border-radius: 22px;
    padding: 20px;
    box-shadow: var(--bl-shadow-lg);
    margin-bottom: 16px;
}
.bl-hero .bl-hero-label { opacity: .85; font-size: 13px; font-weight: 600; }
.bl-hero .bl-hero-amount { font-size: 34px; font-weight: 800; letter-spacing: -.5px; margin: 2px 0 10px; }
.bl-hero .bl-hero-sub { display: flex; gap: 24px; font-size: 13px; opacity: .9; }
.bl-hero .bl-hero-sub b { display: block; font-size: 15px; font-weight: 700; }
.bl-chip-row { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; }
.bl-chip-row::-webkit-scrollbar { display: none; }
.bl-chip {
    flex: 0 0 auto;
    padding: 6px 14px; border-radius: 999px;
    font-size: 12px; font-weight: 600;
    background: rgba(255,255,255,.16); color: #fff;
    border: none; text-decoration: none; white-space: nowrap;
}
.bl-chip.active { background: #fff; color: var(--bl-primary); }

/* ---------- Section titles ---------- */
.bl-section-title {
    font-size: 12px; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: var(--bl-muted);
    margin: 18px 4px 10px;
}

/* ---------- Quick actions ---------- */
.bl-quick { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.bl-quick::-webkit-scrollbar { display: none; }
.bl-quick a {
    flex: 0 0 auto; width: 92px;
    background: #fff; border-radius: var(--bl-radius-sm);
    box-shadow: var(--bl-shadow);
    padding: 14px 8px; text-align: center; text-decoration: none;
    color: var(--bl-ink); font-size: 12px; font-weight: 600;
}
.bl-quick .bl-qi {
    width: 40px; height: 40px; margin: 0 auto 8px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px; background: #efeafe; color: var(--bl-primary);
    font-size: 18px;
}

/* ---------- List rows (documents / clients) ---------- */
.bl-row {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; text-decoration: none; color: var(--bl-ink);
    border-bottom: 1px solid var(--bl-line);
}
.bl-row:last-child { border-bottom: none; }
.bl-avatar {
    width: 42px; height: 42px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: #efeafe; color: var(--bl-primary);
    font-weight: 700;
}
.bl-avatar.ok { background: #e7f7ef; color: var(--bl-success); }
.bl-row-main { flex: 1 1 auto; min-width: 0; }
.bl-row-main .t { font-weight: 700; font-size: 15px; }
.bl-row-main .s { color: var(--bl-muted); font-size: 12px; }
.bl-row-end { text-align: right; white-space: nowrap; }
.bl-row-end .a { font-weight: 700; }

/* ---------- Status pills ---------- */
.bl-pill {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 700;
}
.bl-pill-success { background: #e7f7ef; color: #06864a; }
.bl-pill-info    { background: #e7f0ff; color: #1461c9; }
.bl-pill-warning { background: #fff2df; color: #b45309; }
.bl-pill-danger  { background: #ffe9e7; color: #c4291c; }
.bl-pill-secondary { background: #eef0f5; color: #5b6270; }
.bl-pill-primary { background: #efeafe; color: #4a37cf; }

/* ---------- Buttons ---------- */
.btn { border-radius: var(--bl-radius-sm); font-weight: 700; padding: 12px 18px; }
.btn-lg { padding: 15px 20px; font-size: 16px; }
.btn-primary { background: var(--bl-primary); border-color: var(--bl-primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--bl-primary-600); border-color: var(--bl-primary-600); }
.btn-success { background: var(--bl-success); border-color: var(--bl-success); }
.btn-block { width: 100%; }

/* ---------- Progress ---------- */
.bl-progress { height: 10px; border-radius: 999px; background: #edeef3; overflow: hidden; }
.bl-progress > span { display: block; height: 100%; background: var(--bl-success); border-radius: 999px; }

/* ---------- Icon set (replaces the old emoji glyphs) ---------- */
.bl-icon { width: 20px; height: 20px; flex: 0 0 auto; display: block; transition: transform .2s; }

/* ---------- Bottom navigation ---------- */
/* Floats above the bottom edge with side margins and fully rounded corners,
   rather than a flat bar flush with the screen edges. */
.bl-bottomnav {
    position: fixed; left: 14px; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 50;
    display: flex; justify-content: space-around;
    background: #fff; border-radius: 22px;
    padding: 10px 6px;
    box-shadow: 0 8px 28px rgba(24,26,42,.12);
}
.bl-bottomnav a {
    position: relative; z-index: 1;
    flex: 1 1 0; text-align: center; text-decoration: none;
    color: var(--bl-muted); font-size: 10px; font-weight: 600;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.bl-bottomnav a .ic { width: 22px; height: 22px; margin-inline: auto; }
.bl-bottomnav a.active { color: var(--bl-primary); }
.bl-bottomnav a.active .ic { transform: scale(1.08); }

/* "Liquid glass" pill that glides to the active tab (see the boot script in
   layouts/app.blade.php — it slides the pill from its last known position to
   the new one on every page load, so switching pages feels animated). */
.bl-navpill {
    position: absolute; top: 6px; left: 0; height: 44px; width: 60px;
    border-radius: 14px; z-index: 0; opacity: 0; pointer-events: none;
    background: color-mix(in srgb, var(--bl-primary) 14%, #fff 86%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    backdrop-filter: blur(10px) saturate(160%);
    border: 1px solid color-mix(in srgb, var(--bl-primary) 28%, #fff 72%);
    box-shadow: 0 2px 10px color-mix(in srgb, var(--bl-primary) 22%, transparent);
}

/* ---------- Floating action button + speed-dial menu ---------- */
.bl-fab-wrap {
    position: fixed; z-index: 51;
    right: max(16px, calc(50% - 260px + 16px));
    bottom: calc(96px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; align-items: flex-end;
}
.bl-fab {
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--bl-primary); color: #fff; border: none;
    display: flex; align-items: center; justify-content: center;
    line-height: 1; text-decoration: none; cursor: pointer;
    box-shadow: 0 8px 22px rgba(91,75,232,.45);
    transition: transform .15s;
}
.bl-fab .bl-icon { width: 24px; height: 24px; }
.bl-fab.open { transform: rotate(45deg); }
.bl-fab-menu { display: none; flex-direction: column; gap: 10px; margin-bottom: 12px; align-items: flex-end; }
.bl-fab-menu.open { display: flex; }
.bl-fab-item {
    display: inline-flex; align-items: center; gap: 8px;
    background: #fff; color: var(--bl-ink); text-decoration: none;
    padding: 11px 18px; border-radius: 999px; box-shadow: var(--bl-shadow-lg);
    font-size: 14px; font-weight: 700; white-space: nowrap;
}
.bl-fab-item .em { width: 18px; height: 18px; }
.bl-fab-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(20,22,40,.18); display: none; }
.bl-fab-backdrop.open { display: block; }

/* ---------- Auth ---------- */
.bl-auth-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 24px;
    background: linear-gradient(160deg, #efeafe 0%, #f4f5f9 40%);
}
.bl-auth-card {
    width: 100%; max-width: 400px; background: #fff;
    border-radius: 22px; box-shadow: var(--bl-shadow-lg);
    padding: 28px 24px;
}
.bl-brand {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    font-size: 26px; font-weight: 800; margin-bottom: 4px;
}
.bl-brand .dot {
    width: 34px; height: 34px; border-radius: 10px;
    background: var(--bl-primary); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 18px;
}
.bl-brand .logo { max-height: 44px; max-width: 220px; object-fit: contain; }
.form-control, .form-select { border-radius: var(--bl-radius-sm); padding: 12px 14px; border-color: #e3e6ee; }
.form-control:focus { border-color: var(--bl-primary); box-shadow: 0 0 0 3px rgba(91,75,232,.15); }
.form-label { font-weight: 600; font-size: 13px; }

.tab-scroller { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.tab-scroller::-webkit-scrollbar { display: none; }
.bl-tab {
    flex: 0 0 auto; padding: 8px 16px; border-radius: 999px;
    font-size: 13px; font-weight: 700; text-decoration: none;
    background: #fff; color: var(--bl-muted); border: 1px solid var(--bl-line);
}
.bl-tab.active { background: var(--bl-primary); color: #fff; border-color: var(--bl-primary); }

/* ============================================================
   Desktop shell (≥992px) — left sidebar replaces the bottom nav.
   The sidebar is hidden on mobile; everything below only applies
   on wide screens so the phone layout is untouched.
   ============================================================ */
.bl-sidebar { display: none; }

@media (min-width: 992px) {
    /* Room for the fixed sidebar; drop the mobile bottom-nav spacing */
    body { padding-bottom: 0; padding-left: 260px; }

    .bl-sidebar {
        display: flex; flex-direction: column;
        position: fixed; top: 0; left: 0; bottom: 0; width: 260px; z-index: 60;
        background: #fff; border-right: 1px solid var(--bl-line);
        padding: 20px 14px; overflow-y: auto;
    }
    .bl-sidebar-brand {
        display: flex; align-items: center; gap: 10px;
        font-size: 20px; font-weight: 800; color: var(--bl-ink);
        text-decoration: none; padding: 6px 10px 18px;
    }
    .bl-sidebar-brand .dot {
        width: 32px; height: 32px; border-radius: 9px; flex: 0 0 auto;
        background: var(--bl-primary); color: #fff;
        display: inline-flex; align-items: center; justify-content: center; font-size: 17px;
    }
    .bl-sidebar-brand .logo { max-height: 36px; max-width: 120px; object-fit: contain; flex: 0 0 auto; }
    .bl-sidebar-brand .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .bl-sidebar-section {
        font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
        color: var(--bl-muted); margin: 18px 12px 6px;
    }
    .bl-sidebar-nav { position: relative; display: flex; flex-direction: column; gap: 2px; }
    .bl-sidebar-nav a {
        position: relative; z-index: 1;
        display: flex; align-items: center; gap: 12px;
        padding: 11px 12px; border-radius: 12px;
        color: var(--bl-ink); text-decoration: none; font-size: 14px; font-weight: 600;
    }
    .bl-sidebar-nav a .ic { width: 19px; height: 19px; }
    .bl-sidebar-nav a:hover { background: #f4f5f9; }
    .bl-sidebar-nav a.active { color: var(--bl-primary); }
    .bl-sidebar-nav a.active .ic { transform: scale(1.08); }

    /* Same gliding "glass" pill as the mobile bottom nav, sliding vertically.
       width:auto overrides .bl-navpill's fixed 60px so left/right can stretch
       it across the full row instead of leaving it icon-sized. */
    .bl-navpill-v {
        position: absolute; left: 0; right: 0; top: 0; width: auto; height: 42px;
        border-radius: 12px; z-index: 0; opacity: 0; pointer-events: none;
        background: color-mix(in srgb, var(--bl-primary) 12%, #fff 88%);
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
        border: 1px solid color-mix(in srgb, var(--bl-primary) 24%, #fff 76%);
    }

    .bl-sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--bl-line); }
    .bl-sidebar-foot a,
    .bl-sidebar-logout {
        display: flex; align-items: center; gap: 12px; width: 100%;
        padding: 11px 12px; border-radius: 12px;
        color: var(--bl-ink); text-decoration: none; font-size: 14px; font-weight: 600;
        background: none; border: none; text-align: left; cursor: pointer;
    }
    .bl-sidebar-foot a .ic,
    .bl-sidebar-logout .ic { width: 19px; height: 19px; }
    .bl-sidebar-foot a:hover,
    .bl-sidebar-logout:hover { background: #f4f5f9; }
    .bl-sidebar-foot a.active { background: #efeafe; color: var(--bl-primary); }
    .bl-sidebar-logout { color: var(--bl-danger); }

    /* Content area: comfortable centered column in the remaining space */
    .bl-app { max-width: 1080px; margin-inline: auto; padding: 28px 40px 48px; }

    /* Bottom nav belongs to the phone layout; keep the quick-create FAB,
       pinned to the bottom-right of the viewport. */
    .bl-bottomnav { display: none !important; }
    .bl-fab-wrap { right: 32px; bottom: 32px; }

    /* Desktop topbar: left-aligned title, drop the redundant menu button and
       the mobile centering spacers, keep back/action buttons on the right. */
    .bl-topbar { justify-content: flex-start; gap: 14px; padding: 0 0 20px; }
    .bl-topbar h1 { font-size: 26px; margin-right: auto; }
    .bl-topbar a[href$="/settings"].bl-iconbtn { display: none; }
    .bl-topbar .bl-iconbtn[style*="visibility"] { display: none; }

    /* Give the dashboard hero a sensible cap so it doesn't stretch full width */
    .bl-hero { max-width: 640px; }
    .bl-quick a { width: 120px; }
}
