:root {
    --bio-primary: #0f766e;
    --bio-primary-dark: #115e59;
    --bio-ink: #172033;
    --bio-border: #e7ecf3;
    --bio-bg: #f5f7fb;
    --bio-accent: #2563eb;
}

body {
    background: var(--bio-bg);
    color: var(--bio-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

.auth-shell {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, .9), rgba(37, 99, 235, .78)),
        url("https://images.unsplash.com/photo-1587316745621-3757c7076b67?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.auth-card,
.app-card,
.modal-content {
    border: 1px solid var(--bio-border);
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(23, 32, 51, .08);
}

.brand-mark {
    align-items: center;
    background: linear-gradient(135deg, var(--bio-primary), var(--bio-accent));
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    font-weight: 800;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.brand-logo-icon {
    background: #fff;
    border: 1px solid var(--bio-border);
    border-radius: 8px;
    height: 46px;
    object-fit: contain;
    padding: 5px;
    width: 46px;
}

.auth-logo {
    display: block;
    height: auto;
    margin-left: auto;
    margin-right: auto;
    max-height: 150px;
    max-width: 260px;
    object-fit: contain;
    width: 72%;
}

.mobile-menu-button,
.top-icon {
    align-items: center;
    border: 1px solid var(--bio-border);
    border-radius: 8px;
    display: inline-flex;
    height: 42px;
    justify-content: center;
    min-width: 42px;
    padding: 0;
}

.app-shell {
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    min-height: 100vh;
    transition: grid-template-columns .18s ease;
}

.app-shell.sidebar-collapsed {
    grid-template-columns: 78px minmax(0, 1fr);
}

.sidebar {
    background: #ffffff;
    border-right: 1px solid var(--bio-border);
    min-height: 100vh;
    padding: 22px 18px;
    position: sticky;
    top: 0;
}

.sidebar a {
    align-items: center;
    border-radius: 8px;
    color: #334155;
    display: flex;
    font-weight: 600;
    gap: 10px;
    padding: 10px 12px;
    text-decoration: none;
    white-space: nowrap;
}

.sidebar a i {
    flex: 0 0 20px;
    text-align: center;
}

.sidebar-toggle {
    height: 34px;
    width: 34px;
}

.sidebar-collapsed .sidebar {
    padding-left: 12px;
    padding-right: 12px;
}

.sidebar-collapsed .sidebar a {
    justify-content: center;
    padding-left: 10px;
    padding-right: 10px;
}

.sidebar-collapsed .sidebar-text {
    display: none !important;
}

.sidebar a.active,
.sidebar a:hover {
    background: #eaf7f5;
    color: var(--bio-primary-dark);
}

.nav-section {
    color: #94a3b8;
    font-size: .72rem;
    font-weight: 800;
    margin: 22px 12px 8px;
    text-transform: uppercase;
}

.main {
    min-width: 0;
}

.topbar {
    align-items: center;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--bio-border);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    min-height: 60px;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.content {
    padding: 28px 28px 58px;
}

.page-title {
    font-size: 1.08rem;
    font-weight: 800;
    margin: 0;
}

.top-company-logo {
    border-radius: 8px;
    height: 34px;
    object-fit: contain;
    width: 42px;
}

.top-title-block .small {
    line-height: 1.1;
}

.user-chip {
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--bio-border);
    border-radius: 8px;
    display: inline-flex;
    font-size: .84rem;
    font-weight: 700;
    gap: 6px;
    min-height: 38px;
    padding: 0 10px;
}

.kpi-card {
    border-left: 4px solid var(--bio-primary);
}

.kpi-card .value {
    font-size: 1.55rem;
    font-weight: 800;
}

.btn-primary {
    --bs-btn-bg: var(--bio-primary);
    --bs-btn-border-color: var(--bio-primary);
    --bs-btn-hover-bg: var(--bio-primary-dark);
    --bs-btn-hover-border-color: var(--bio-primary-dark);
}

.table > :not(caption) > * > * {
    padding: .9rem .75rem;
}

.table-nowrap th,
.table-nowrap td {
    white-space: nowrap;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-bg-type: #f8fafc;
}

table[data-table] > tbody > tr:nth-of-type(odd) > * {
    background-color: #f8fafc;
}

.table-nowrap td:first-child,
.table-nowrap td:nth-child(2) {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-select {
    max-width: 260px;
}

.company-context {
    background: #fff;
    border: 1px solid var(--bio-border);
    border-radius: 8px;
    min-height: 38px;
    padding: 4px 8px;
}

.app-footer {
    background: rgba(255, 255, 255, .92);
    border-top: 1px solid var(--bio-border);
    bottom: 0;
    color: #64748b;
    font-size: .78rem;
    padding: 8px 24px;
    position: fixed;
    right: 0;
    text-align: right;
    left: 268px;
    z-index: 18;
}

.sidebar-collapsed .app-footer {
    left: 78px;
}

.status-pill {
    border-radius: 999px;
    display: inline-flex;
    font-size: .78rem;
    font-weight: 800;
    padding: .3rem .65rem;
}

.status-aberto {
    background: #fff7ed;
    color: #c2410c;
}

.status-pago {
    background: #ecfdf5;
    color: #047857;
}

.status-cancelado {
    background: #f1f5f9;
    color: #64748b;
}

.filter-band {
    background: #fff;
    border: 1px solid var(--bio-border);
    border-radius: 8px;
    padding: 16px;
}

.calendar-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-day {
    background: #f8fafc;
    border: 1px solid var(--bio-border);
    border-radius: 8px;
    min-height: 72px;
    padding: 8px;
}

@media (max-width: 991.98px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: 0;
        min-height: 100vh;
        padding: 0;
        position: fixed;
        width: min(86vw, 320px);
    }

    .app-shell.sidebar-collapsed,
    .app-shell {
        grid-template-columns: 1fr;
    }

    .topbar,
    .content {
        padding-left: 14px;
        padding-right: 14px;
    }

    .topbar {
        min-height: 58px;
    }

    .user-actions {
        flex-shrink: 0;
    }

    .company-select {
        max-width: 160px;
    }

    .page-title {
        font-size: 1.1rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .content {
        padding-top: 18px;
    }

    .app-footer {
        left: 0;
        text-align: center;
    }

    .app-card {
        box-shadow: 0 10px 28px rgba(23, 32, 51, .07);
    }

    .filter-band {
        padding: 12px;
    }
}

@media (max-width: 420px) {
    .user-actions .badge {
        display: none;
    }
}

@media (min-width: 992px) {
    .sidebar.offcanvas-lg {
        height: 100vh;
        transform: none;
        visibility: visible !important;
    }

    .sidebar .offcanvas-body {
        overflow: visible;
        padding: 0;
    }
}
