/*
 * Laika Bill Manager — panel / bootstrap
 * Author: Showket Ahmed
 *
 * A thin layer over Bootstrap 5 for the client area. Bootstrap ships the grid,
 * forms and utilities; everything here is the shell (sidebar, topbar), the
 * surfaces (cards, tables) and the pieces Bootstrap has no opinion about
 * (status pills, the donut chart).
 *
 * A full copy of the admin sheet today, and free to diverge: the two templates
 * are chosen by separate options and share nothing.
 *
 * This file lives inside the template it belongs to, at
 * template/<area>/<name>/assets/, and is linked from that template's own
 * partials/header.twig. A template is one directory: copy it to install it,
 * delete it to remove it, and nothing of it is left anywhere else.
 */

:root {
    --lbm-primary:        #0f4c81;
    --lbm-primary-light:  #1a6fb5;
    --lbm-primary-dark:   #0a3a63;
    --lbm-accent:         #f5a623;
    --lbm-success:        #00c896;
    --lbm-danger:         #e84545;

    --lbm-bg:             #f0f4f9;
    --lbm-card-bg:        #ffffff;
    --lbm-sidebar-bg:     #0a2e50;
    --lbm-sidebar-text:   #a8c4e0;
    --lbm-sidebar-active: #ffffff;

    --lbm-text:           #1a2b3c;
    --lbm-text-muted:     #6b85a0;
    --lbm-border:         #dce8f5;

    --lbm-shadow:         0 4px 24px rgba(15, 76, 129, .08);
    --lbm-shadow-lg:      0 12px 40px rgba(15, 76, 129, .16);
    --lbm-radius:         .625rem;
    --lbm-sidebar-width:  260px;
    --lbm-topbar-height:  62px;
}

/* ==========================================================================
   Base
   ========================================================================== */

body {
    background: var(--lbm-bg);
    color: var(--lbm-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: .9375rem;
    min-height: 100vh;
}

a { color: var(--lbm-primary); text-decoration: none; }
a:hover { color: var(--lbm-primary-light); text-decoration: underline; }

.text-muted { color: var(--lbm-text-muted) !important; }

/* Bootstrap's .btn-primary, repainted to the product palette. */
.btn-primary {
    --bs-btn-bg: var(--lbm-primary);
    --bs-btn-border-color: var(--lbm-primary);
    --bs-btn-hover-bg: var(--lbm-primary-light);
    --bs-btn-hover-border-color: var(--lbm-primary-light);
    --bs-btn-active-bg: var(--lbm-primary-dark);
    --bs-btn-active-border-color: var(--lbm-primary-dark);
    --bs-btn-disabled-bg: var(--lbm-primary);
    --bs-btn-disabled-border-color: var(--lbm-primary);
}

.btn-outline-primary {
    --bs-btn-color: var(--lbm-primary);
    --bs-btn-border-color: var(--lbm-primary);
    --bs-btn-hover-bg: var(--lbm-primary);
    --bs-btn-hover-border-color: var(--lbm-primary);
    --bs-btn-active-bg: var(--lbm-primary);
    --bs-btn-active-border-color: var(--lbm-primary);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--lbm-primary-light);
    box-shadow: 0 0 0 .2rem rgba(26, 111, 181, .15);
}

/* ==========================================================================
   Text color
   ========================================================================== */
.text-primary {
    color: var(--lbm-primary)!important;
}
.text-primary-light {
    color: var(--lbm-primary-light)!important;
}
.text-primary-dark {
    color: var(--lbm-primary-dark)!important;
}
.text-accent {
    color: var(--lbm-accent)!important;
}
.text-success {
    color: var(--lbm-success)!important;
}
.text-danger {
    color: var(--lbm-danger)!important;
}
.text-default {
    color: var(--lbm-text)!important;
}
.text-muted {
    color: var(--lbm-text-muted)!important;
}

/* ==========================================================================
   Shell — sidebar + topbar
   ========================================================================== */

.lbm-shell { min-height: 100vh; }

.lbm-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--lbm-sidebar-width);
    background: var(--lbm-sidebar-bg);
    color: var(--lbm-sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform .2s ease;
    overflow-y: auto;
}

.lbm-sidebar__brand {
    display: flex;
    align-items: center;
    gap: .625rem;
    height: var(--lbm-topbar-height);
    padding: 0 1.25rem;
    color: #fff;
    font-weight: 700;
    letter-spacing: .01em;
    flex: 0 0 auto;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.lbm-sidebar__brand:hover { color: #fff; text-decoration: none; }

.lbm-sidebar__mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--lbm-primary-light), var(--lbm-accent));
    display: grid;
    place-items: center;
    font-size: 1rem;
    flex: 0 0 auto;
}

.lbm-sidebar__mark img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }

.lbm-sidebar__nav { padding: .875rem 0 1.5rem; flex: 1 1 auto; }

.lbm-sidebar__label {
    padding: 1rem 1.25rem .375rem;
    font-size: .6875rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(168, 196, 224, .55);
    font-weight: 600;
}

.lbm-sidebar__link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5625rem 1.25rem;
    color: var(--lbm-sidebar-text);
    font-size: .875rem;
    border-left: 3px solid transparent;
}

.lbm-sidebar__link:hover {
    background: rgba(255, 255, 255, .05);
    color: var(--lbm-sidebar-active);
    text-decoration: none;
}

.lbm-sidebar__link.is-active {
    background: rgba(255, 255, 255, .08);
    color: var(--lbm-sidebar-active);
    border-left-color: var(--lbm-accent);
    font-weight: 600;
}

.lbm-sidebar__link i { width: 1.125rem; text-align: center; font-size: 1rem; }

/* A submenu (Navigation): a <details>, so it opens without script. */
.lbm-sidebar__group > summary { list-style: none; cursor: pointer; }
.lbm-sidebar__group > summary::-webkit-details-marker { display: none; }
.lbm-sidebar__group > summary::after { content: "\203A"; margin-left: auto; transition: transform .15s; }
.lbm-sidebar__group[open] > summary::after { transform: rotate(90deg); }
.lbm-sidebar__sublink { padding-left: 3.25rem; font-size: .8125rem; }

.lbm-main {
    margin-left: var(--lbm-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.lbm-topbar {
    height: var(--lbm-topbar-height);
    background: var(--lbm-card-bg);
    border-bottom: 1px solid var(--lbm-border);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.lbm-content { padding: 1.5rem 1.25rem 3rem; flex: 1 1 auto; }

.lbm-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--lbm-border);
    background: #fff;
    color: var(--lbm-text-muted);
    display: grid;
    place-items: center;
}

.lbm-icon-btn:hover { color: var(--lbm-primary); border-color: var(--lbm-primary-light); text-decoration: none; }

.lbm-sidebar__toggle { display: none; }

@media (max-width: 991.98px) {
    .lbm-sidebar { transform: translateX(-100%); }
    .lbm-sidebar.is-open { transform: translateX(0); box-shadow: var(--lbm-shadow-lg); }
    .lbm-main { margin-left: 0; }
    .lbm-sidebar__toggle { display: grid; }
    .lbm-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(10, 46, 80, .45);
        z-index: 1035;
    }
}

/* ==========================================================================
   Surfaces
   ========================================================================== */

.lbm-card {
    background: var(--lbm-card-bg);
    border: 1px solid var(--lbm-border);
    border-radius: var(--lbm-radius);
    box-shadow: var(--lbm-shadow);
}

.lbm-card__head {
    padding: .875rem 1.125rem;
    border-bottom: 1px solid var(--lbm-border);
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.lbm-card__title { font-size: .9375rem; font-weight: 700; margin: 0; }
.lbm-card__body { padding: 1.125rem; }
.lbm-card__foot { padding: .75rem 1.125rem; border-top: 1px solid var(--lbm-border); }

.lbm-page-title { font-size: 1.25rem; font-weight: 700; margin: 0; }

/* Stat tiles */
.lbm-stat { display: flex; align-items: center; gap: .875rem; padding: 1.125rem; }
.lbm-stat__icon {
    width: 46px;
    height: 46px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    color: #fff;
    flex: 0 0 auto;
}
.lbm-stat__value { font-size: 1.375rem; font-weight: 700; line-height: 1.15; }
.lbm-stat__label { font-size: .75rem; color: var(--lbm-text-muted); text-transform: uppercase; letter-spacing: .05em; }

/* ==========================================================================
   Tables
   ========================================================================== */

.lbm-table {
    margin: 0;
    width:100%;
}
.lbm-table > :not(caption) > * > * { padding: .75rem 1.125rem; }

.lbm-table thead th {
    background: #f7fafd;
    border-bottom: 1px solid var(--lbm-border);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--lbm-text-muted);
    font-weight: 700;
    white-space: nowrap;
}

.lbm-table tbody tr:hover { background: #f7fafd; }
.lbm-table td { vertical-align: middle; border-bottom: 1px solid var(--lbm-border); }
.lbm-table tbody tr:last-child td { border-bottom: 0; }

/* A wide table scrolls inside its own card rather than the page. */
.lbm-table-wrap { overflow-x: auto; }

/* ==========================================================================
   Status pills — colours come from the *_color column, never from CSS
   ========================================================================== */

.lbm-pill {
    display: inline-block;
    padding: .1875rem .5625rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.45;
    white-space: nowrap;
}

/* ==========================================================================
   Empty states
   ========================================================================== */

.lbm-empty { padding: 3rem 1.25rem; text-align: center; color: var(--lbm-text-muted); }
.lbm-empty i { font-size: 2.5rem; opacity: .35; display: block; margin-bottom: .75rem; }

/* ==========================================================================
   Auth + install — centred card on a tinted ground
   ========================================================================== */

.lbm-centre {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(160deg, var(--lbm-sidebar-bg), var(--lbm-primary) 60%, var(--lbm-primary-light));
}

.lbm-centre__card {
    width: 100%;
    max-width: 27rem;
    background: var(--lbm-card-bg);
    border-radius: var(--lbm-radius);
    box-shadow: var(--lbm-shadow-lg);
    overflow: hidden;
}

.lbm-centre__card--wide { max-width: 48rem; }

.lbm-centre__head { padding: 1.75rem 1.75rem 0; text-align: center; }
.lbm-centre__body { padding: 1.5rem 1.75rem 1.75rem; }

.lbm-brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--lbm-primary), var(--lbm-accent));
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.5rem;
    margin: 0 auto .875rem;
}

.lbm-brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }

/* Wizard step rail */
.lbm-steps {
    display: flex;
    gap: .25rem;
    padding: 1.125rem 1.75rem;
    border-bottom: 1px solid var(--lbm-border);
    background: #f7fafd;
    flex-wrap: wrap;
}

.lbm-step { display: flex; align-items: center; gap: .5rem; font-size: .8125rem; color: var(--lbm-text-muted); }
.lbm-step + .lbm-step { margin-left: .25rem; }

.lbm-step__no {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: .75rem;
    font-weight: 700;
    background: #e4edf7;
    color: var(--lbm-text-muted);
    flex: 0 0 auto;
}

.lbm-step.is-current { color: var(--lbm-primary); font-weight: 600; }
.lbm-step.is-current .lbm-step__no { background: var(--lbm-primary); color: #fff; }
.lbm-step.is-done .lbm-step__no { background: var(--lbm-success); color: #fff; }

.lbm-step__sep { color: var(--lbm-border); align-self: center; }

/* Requirement rows */
.lbm-req { display: flex; align-items: center; gap: .75rem; padding: .5625rem 0; border-bottom: 1px solid var(--lbm-border); }
.lbm-req:last-child { border-bottom: 0; }
.lbm-req__name { flex: 1 1 auto; }
.lbm-req__state { font-size: .8125rem; font-weight: 600; }
.lbm-req--ok .lbm-req__state { color: var(--lbm-success); }
.lbm-req--fail .lbm-req__state { color: var(--lbm-danger); }

/* ==========================================================================
   Status legend
   ========================================================================== */

.lbm-legend { display: flex; flex-direction: column; gap: .5rem; }
.lbm-legend__item { display: flex; align-items: center; gap: .5rem; font-size: .8125rem; }
.lbm-legend__dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }

/* ==========================================================================
   Print — invoices
   ========================================================================== */

@media print {
    .lbm-sidebar, .lbm-topbar, .lbm-no-print { display: none !important; }
    .lbm-main { margin-left: 0; }
    .lbm-content { padding: 0; }
    .lbm-card { border: 0; box-shadow: none; }
    body { background: #fff; }
}

/* ==========================================================================
   Inputs in rows and tables
   ========================================================================== */

/* A number box in a row or a table cell: Bootstrap's 100% width shrinks to
   a sliver beside a button or in a busy table, so it gets a width of its own. */
.lbm-qty { width: 5rem; flex: 0 0 5rem; }
td > .form-control, td > .form-select { min-width: 6rem; }
td > .form-control.lbm-cell-wide { min-width: 12rem; }

/* Bootstrap's primary badge, in the product blue like the buttons. */
.text-bg-primary { background-color: var(--lbm-primary) !important; color: #fff !important; }

/* Buttons, one family (2026-10-11): a label never wraps, an icon sits in
   line with its words, and the quiet (secondary) button is a white button
   with a readable label that turns blue on hover -- not a grey one that
   looks switched off and goes solid grey when pressed. Danger is an outline
   until hovered, so "Switch off" never shouts. */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    white-space: nowrap;
    font-weight: 500;
    line-height: 1.25;
}
.btn-sm { --bs-btn-padding-y: .3125rem; --bs-btn-padding-x: .75rem; --bs-btn-font-size: .8125rem; border-radius: .375rem; }
.btn svg { flex: 0 0 auto; }
.btn-link { font-weight: 400; }

.btn-outline-secondary {
    --bs-btn-color: var(--lbm-text);
    --bs-btn-bg: #fff;
    --bs-btn-border-color: #c9d3df;
    --bs-btn-hover-color: var(--lbm-primary);
    --bs-btn-hover-bg: #f2f7fc;
    --bs-btn-hover-border-color: var(--lbm-primary-light);
    --bs-btn-active-color: var(--lbm-primary-dark);
    --bs-btn-active-bg: #e6eff8;
    --bs-btn-active-border-color: var(--lbm-primary);
    --bs-btn-disabled-color: var(--lbm-text-muted);
    --bs-btn-disabled-bg: #fff;
    --bs-btn-disabled-border-color: #dee4ec;
}
.btn-outline-primary {
    --bs-btn-bg: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
}
.btn-outline-danger {
    --bs-btn-color: #c0392b;
    --bs-btn-bg: #fff;
    --bs-btn-border-color: #e3a59e;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #c0392b;
    --bs-btn-hover-border-color: #c0392b;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #a93226;
    --bs-btn-active-border-color: #a93226;
}

/* Email forwarding (2026-10-11): wide enough to read on a desktop; on a
   phone each forward is two lines, the address over where it goes, with
   Remove beside them. */
.lbm-forwards__from { min-width: 13rem; }
.lbm-forwards__to { min-width: 14rem; }
@media (max-width: 575.98px) {
    .lbm-forwards thead { display: none; }
    .lbm-forwards tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .375rem .75rem; padding: .625rem .75rem; border-bottom: 1px solid var(--bs-border-color); }
    .lbm-forwards td { display: block; padding: 0; border: 0; min-width: 0; }
    .lbm-forwards td.lbm-forwards__arrow { display: none; }
    .lbm-forwards td.lbm-forwards__from { grid-column: 1; grid-row: 1; }
    .lbm-forwards td.lbm-forwards__to { grid-column: 1; grid-row: 2; }
    .lbm-forwards td.lbm-forwards__remove { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
    .lbm-forwards td > .form-control { min-width: 0; }
}

/* The sign-up card (2026-10-13): two columns, tighter, so the form fits one screen. */
.lbm-centre__card--form { max-width: 37rem; }
.lbm-centre__card--form .lbm-centre__head { padding: 1.1rem 1.5rem 0; }
.lbm-centre__card--form .lbm-brand-mark { width: 40px; height: 40px; border-radius: 11px; margin-bottom: .4rem; }
.lbm-centre__card--form .lbm-centre__body { padding: 1rem 1.5rem 1.25rem; }
.lbm-centre__card--form .form-label { font-size: .8rem; margin-bottom: .15rem; }
.lbm-centre__card--form .form-control,
.lbm-centre__card--form .form-select { padding-top: .35rem; padding-bottom: .35rem; }
.lbm-centre:has(.lbm-centre__card--form) { padding-top: 1rem; padding-bottom: 1rem; }


/* The live password checklist, strength bar and "do they match" note (2026-10-13). */
.lbm-pw__bar { height: 4px; border-radius: 2px; background: #e2e8f0; overflow: hidden; }
.lbm-pw__bar span { display: block; height: 100%; width: 0; transition: width .15s ease; }
.lbm-pw__fill--weak { background: #dc3545; }
.lbm-pw__fill--fair { background: #fd7e14; }
.lbm-pw__fill--good { background: #198754; }
.lbm-pw__fill--strong { background: #0d6e3f; }
.lbm-pw__label { margin-top: .2rem; color: #64748b; min-height: 1.1em; }
.lbm-pw__rules { display: flex; flex-wrap: wrap; gap: .1rem .9rem; }
.lbm-pw__rules li { color: #64748b; }
.lbm-pw__rules li::before { content: "\25CB"; display: inline-block; width: 1.1em; }
.lbm-pw__rules li.is-met { color: #198754; }
.lbm-pw__rules li.is-met::before { content: "\2713"; }
.lbm-match.is-met { color: #198754; }
.lbm-match.is-unmet { color: #dc3545; }

/* A flag from the flag sheet (img/flags.png, 1x = 5630px wide, one every 22px) and the sign-up's phone-country picker. */
.lbm-flag { display: inline-block; flex: 0 0 auto; width: 20px; height: 15px; background: url("../img/flags.png") no-repeat 0 0; background-size: 5630px 15px; align-self: center; }
.lbm-flag--none { background: none; }
.lbm-phone-pick { flex: 0 0 auto; display: flex; }
.lbm-phone-pick__btn { display: flex; align-items: center; gap: .4rem; width: auto; min-width: 6.2rem; text-align: left; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.lbm-phone-pick__btn .lbm-flag { position: relative; top: 1.5px; }
.lbm-phone-pick__menu { width: 17rem; max-width: 90vw; }
.lbm-phone-pick__list { max-height: 15rem; overflow-y: auto; }
.lbm-centre__card--form .input-group > select[data-lbm-phone-country] { width: auto; flex: 0 0 auto; }
