@font-face {
    font-family: Inter;
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url("vendor/inter/inter-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: Inter;
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url("vendor/inter/inter-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root, [data-bs-theme="light"] {
    --font-ui: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bg-app: #f4f6fa;
    --surface: #fff;
    --surface-subtle: #f9fafb;
    --fill-muted: #f2f4f7;
    --border-card: #e4e7ec;
    --border-divider: #eaecf0;
    --border-control: #d0d5dd;
    --text-primary: #101828;
    --text-secondary: #344054;
    --text-tertiary: #475467;
    --text-muted: #667085;
    --primary: #4f46e5;
    --primary-deep: #4338ca;
    --primary-soft: #eef2ff;
    --primary-border: #c7d2fe;
    --success-deep: #067647;
    --success-soft-bg: #f0fdf4;
    --success-border: #86efac;
    --warning-bg: #fef3c7;
    --warning-text: #92400e;
    --danger-text: #b42318;
    --danger-bg: #fef3f2;
    --ring-card: inset 0 0 0 1px var(--border-card);
    --shadow-card: 0 2px 10px -2px rgb(10 18 38 / 10%);
    --radius-sm: 7px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-card: 14px;
    --itbi-nav-bg: #282f74;
    --itbi-auth-button: #1a2c63;
    --itbi-nav-mobile-height: 68px;

    --bs-font-sans-serif: var(--font-ui);
    --bs-body-font-family: var(--font-ui);
    --bs-body-font-size: .875rem;
    --bs-body-bg: var(--bg-app);
    --bs-body-color: var(--text-primary);
    --bs-secondary-color: var(--text-muted);
    --bs-primary: var(--primary);
    --bs-primary-rgb: 79, 70, 229;
    --bs-link-color: var(--primary);
    --bs-link-color-rgb: 79, 70, 229;
    --bs-link-hover-color: var(--primary-deep);
    --bs-link-hover-color-rgb: 67, 56, 202;
    --bs-border-color: var(--border-card);
    --bs-border-radius: var(--radius-lg);
    --bs-border-radius-lg: var(--radius-card);
}

html { scroll-padding-top: 124px; }
body { min-height: 100vh; min-height: 100dvh; }
body:has(.itbi-topbar) { display: flex; flex-direction: column; }
a { text-underline-offset: .15em; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

.skip-link {
    position: fixed;
    top: .5rem;
    left: .75rem;
    z-index: 1050;
    padding: .55rem .85rem;
    transform: translateY(-150%);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    font-weight: 600;
}
.skip-link:not(:focus) { clip-path: inset(50%); }
.skip-link:focus { transform: none; }

.itbi-shell-width { width: min(90%, 1600px); margin-inline: auto; }

.itbi-topbar {
    position: sticky;
    top: 0;
    z-index: 1035;
    background: var(--surface);
    border-bottom: 1px solid var(--border-card);
}

.itbi-navbar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 69px;
    gap: 1rem;
}

.itbi-brand {
    color: #1d2939;
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: .015em;
    text-decoration: none;
    white-space: nowrap;
}
.itbi-brand span, .itbi-brand:hover { color: var(--primary); }

.itbi-account { position: relative; min-width: 0; }
.itbi-account-trigger {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 44px;
    padding: .45rem .6rem;
    color: var(--text-secondary);
    border-radius: var(--radius-lg);
    list-style: none;
    cursor: pointer;
}

.itbi-account-trigger::-webkit-details-marker { display: none; }
.itbi-account-trigger:hover, .itbi-account[open] .itbi-account-trigger { background: var(--surface-subtle); }
.itbi-account-label { display: grid; min-width: 0; text-align: start; }
.itbi-account-name { font-weight: 600; color: var(--text-primary); }
.itbi-account-label .itbi-account-name { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.itbi-account-tenant { color: var(--text-muted); font-size: .75rem; }
.itbi-account-chevron { font-size: 1.1rem; color: var(--text-muted); }

.itbi-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    color: #fff;
    background: #6454de;
    border-radius: 50%;
    font-size: .76rem;
    font-weight: 700;
}

.itbi-account-menu {
    position: absolute;
    top: calc(100% + .4rem);
    right: 0;
    display: grid;
    width: max-content;
    min-width: min(13rem, 85vw);
    max-width: min(22rem, 85vw);
    padding: .85rem;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    box-shadow: 0 14px 34px -10px rgb(2 6 23 / 18%);
    overflow-wrap: anywhere;
}
.itbi-account-menu form { margin-top: .65rem; padding-top: .5rem; border-top: 1px solid var(--border-divider); }

.itbi-account-sign-out {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    min-height: 36px;
    padding: .35rem .5rem;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-secondary);
    text-align: start;
}
.itbi-account-sign-out:hover { background: var(--fill-muted); color: var(--text-primary); }
.itbi-account-sign-out .mdi { font-size: 1.1rem; }

.itbi-menu-desktop { position: sticky; top: 70px; z-index: 1030; color: #fff; background: var(--itbi-nav-bg); }
.itbi-menu-inner { display: flex; align-items: center; gap: .45rem; min-height: 54px; }
.itbi-menu-link {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 38px;
    padding: .35rem .75rem;
    color: #fff;
    border-radius: var(--radius-md);
    font-size: .813rem;
    font-weight: 500;
    text-decoration: none;
}
.itbi-menu-link .mdi { font-size: 1.12rem; line-height: 1; color: rgb(255 255 255 / 84%); }
.itbi-menu-link:hover, .itbi-menu-link:focus-visible { color: #fff; background: rgb(255 255 255 / 10%); }
.itbi-menu-link:focus-visible { outline-color: #fff; }
.itbi-menu-link.is-active { color: #fff; background: rgb(255 255 255 / 17%); font-weight: 600; }
.itbi-menu-link.is-active .mdi { color: #fff; }

.itbi-menu-mobile { display: none; }

.page-content { flex: 1; padding-block: 1.15rem 3rem; }
.page-content:focus, .auth-main:focus { outline: none; }
.itbi-footer {
    padding-block: .9rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-card);
    font-size: .76rem;
}

.card {
    border: 0;
    border-radius: var(--radius-card);
    background-color: var(--surface);
    box-shadow: var(--ring-card), var(--shadow-card);
}
.card .card-header { border-bottom-color: var(--border-divider); background-color: transparent; }
.card-title { color: var(--text-primary); font-weight: 600; }
.btn { border-radius: var(--radius-lg); font-weight: 500; }
.btn-sm { border-radius: var(--radius-md); }

.btn-primary {
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-deep);
    --bs-btn-hover-border-color: var(--primary-deep);
    --bs-btn-active-bg: var(--primary-deep);
    --bs-btn-active-border-color: var(--primary-deep);
    --bs-btn-focus-shadow-rgb: 79, 70, 229;
    --bs-btn-disabled-bg: var(--primary);
    --bs-btn-disabled-border-color: var(--primary);
    font-weight: 600;
    box-shadow: 0 2px 10px -2px rgb(79 70 229 / 45%);
}
.btn-soft-primary {
    --bs-btn-color: var(--primary-deep);
    --bs-btn-bg: var(--primary-soft);
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: #3730a3;
    --bs-btn-hover-bg: #e0e7ff;
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-color: #3730a3;
    --bs-btn-active-bg: #e0e7ff;
    --bs-btn-active-border-color: transparent;
}
.btn-outline-primary {
    --bs-btn-color: var(--primary);
    --bs-btn-border-color: var(--primary-border);
    --bs-btn-hover-bg: var(--primary);
    --bs-btn-hover-border-color: var(--primary);
    --bs-btn-active-bg: var(--primary-deep);
    --bs-btn-active-border-color: var(--primary-deep);
}
.btn-light { --bs-btn-border-color: var(--border-control); }

.form-control, .form-select {
    border-color: var(--border-control);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: .875rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgb(79 70 229 / 12%);
}
.form-label { color: var(--text-secondary); font-weight: 500; }
.table { --bs-table-bg: var(--surface); --bs-table-hover-bg: var(--surface-subtle); }
.table thead th {
    background: var(--surface-subtle);
    color: var(--text-muted);
    font-weight: 600;
    font-size: .7rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.table > :not(caption) > * > * { border-color: var(--border-divider); }
.badge { font-weight: 600; }
.itbi-alert { display: flex; align-items: flex-start; gap: .55rem; border-radius: var(--radius-lg); }
.itbi-alert .mdi { font-size: 1.08rem; line-height: 1.3; }
.itbi-alert.alert-success { color: var(--success-deep); background-color: var(--success-soft-bg); border-color: var(--success-border); }
.itbi-alert.alert-danger { color: var(--danger-text); background-color: var(--danger-bg); border-color: #fecdca; }

.auth-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--surface);
}
.auth-topbar { padding: 1.4rem 2rem; }
.auth-main { flex: 1; display: grid; place-items: center; padding: 1.5rem 1rem 3rem; }
.auth-content { width: min(100%, 500px); }
.auth-card {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgb(16 24 40 / 6%);
}
.auth-card .card-inner { padding: 2.75rem 3rem 3rem; }
.auth-title { color: #1d2939; font-size: 1.6rem; font-weight: 600; margin-bottom: .4rem; }
.auth-subtitle { color: var(--text-tertiary); font-size: .9rem; margin-bottom: 1.75rem; }
.btn-auth-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    min-height: 48px;
    padding: .55rem .75rem;
    border: 0;
    border-radius: 4px;
    color: #fff;
    background: var(--itbi-auth-button);
    font-size: .86rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;
}
.btn-auth-primary:hover, .btn-auth-primary:focus-visible { color: #fff; background: #14224e; }
.auth-footer { padding: 0 1rem 1.75rem; color: var(--text-muted); font-size: .78rem; text-align: center; }

@media (max-width: 991.98px) {
    html { scroll-padding-top: 64px; scroll-padding-bottom: var(--itbi-nav-mobile-height); }
    body:has(.itbi-topbar) {
        padding-bottom: calc(var(--itbi-nav-mobile-height) + env(safe-area-inset-bottom, 0px));
        background: #f6f7fb;
    }
    .itbi-shell-width { width: calc(100% - 2rem); }
    .itbi-navbar-header { min-height: 63px; }
    .itbi-account-label, .itbi-menu-desktop { display: none; }
    .itbi-account-trigger { gap: .25rem; padding: .35rem; }

    .itbi-menu-mobile {
        position: fixed;
        inset: auto 0 0;
        z-index: 1030;
        display: flex;
        min-height: var(--itbi-nav-mobile-height);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: rgb(255 255 255 / 96%);
        border-top: 1px solid var(--border-card);
        box-shadow: 0 -8px 28px -20px rgb(15 23 42 / 35%);
        backdrop-filter: blur(16px);
    }

    .itbi-mobile-link {
        flex: 1 1 0;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: .15rem;
        min-width: 0;
        min-height: var(--itbi-nav-mobile-height);
        padding: .4rem .15rem;
        color: var(--text-muted);
        font-size: .69rem;
        font-weight: 600;
        text-decoration: none;
    }

    .itbi-mobile-link > span:last-child {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .itbi-mobile-link:hover, .itbi-mobile-link.is-active { color: var(--primary); }
    .itbi-mobile-link:focus-visible { outline-offset: -4px; border-radius: var(--radius-lg); }
    .itbi-mobile-icon { display: grid; place-items: center; width: 46px; height: 28px; border-radius: 9px; }
    .itbi-mobile-icon .mdi { font-size: 1.35rem; line-height: 1; }
    .itbi-mobile-link.is-active .itbi-mobile-icon { color: var(--primary); background: #eeedff; }
    .itbi-mobile-create { color: var(--primary); }
    .itbi-mobile-create .itbi-mobile-icon, .itbi-mobile-create.is-active .itbi-mobile-icon {
        width: 44px;
        height: 42px;
        margin-top: -14px;
        color: #fff;
        background: linear-gradient(145deg, #6559f5, #4938e7);
        border-radius: 12px;
        box-shadow: 0 10px 22px -8px rgb(79 70 229 / 72%);
    }
    .itbi-mobile-create .mdi { font-size: 1.55rem; }
}

@media (max-width: 575.98px) {
    .itbi-brand { font-size: 1.16rem; }
    .auth-topbar { padding: 1rem; }
    .auth-card .card-inner { padding: 1.6rem 1.35rem; }
    .auth-main { padding: 1rem 1rem 2rem; }
}
