body {
    font-family: Inter, Arial, sans-serif;
    color: #1f2937;
}

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

@media (min-width: 992px) {
    .app-shell {
        display: grid;
        grid-template-columns: 280px minmax(0, 1fr);
        align-items: stretch;
    }
}

.sidebar {
    min-height: 100vh;
    width: 280px;
    position: sticky;
    top: 0;
}

.sidebar .nav-link {
    border-radius: 0.75rem;
    padding: 0.75rem 0.875rem;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.app-main {
    width: 100%;
    min-width: 0;
}

.app-content {
    padding: 1.5rem;
}

.mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: rgba(248, 249, 250, 0.98);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.mobile-topbar .btn {
    position: relative;
    z-index: 1031;
    pointer-events: auto;
    touch-action: manipulation;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-topbar__title {
    min-width: 0;
    flex: 1;
}

.card {
    border-radius: 1rem;
}

.table > :not(caption) > * > * {
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.modal-content {
    border: 0;
    border-radius: 1rem;
}

.notification-dropdown {
    width: min(420px, 92vw);
}

.notification-list {
    max-height: 420px;
    overflow-y: auto;
}

.section-header {
    gap: 1rem;
}

.table-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.metric-value {
    font-size: clamp(1.8rem, 5vw, 2.75rem);
    line-height: 1.1;
}

@media (max-width: 991.98px) {
    .app-main {
        padding-top: 0;
    }

    .app-content {
        padding: 1rem;
    }

    #mobileSidebar {
        z-index: 1060 !important;
    }

    .offcanvas-backdrop {
        z-index: 1055 !important;
    }

    .offcanvas-backdrop.show {
        opacity: 0.5;
    }

    .card {
        border-radius: 0.875rem;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch !important;
    }

    .section-header .btn {
        width: 100%;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table tbody {
        display: grid;
        gap: 0.875rem;
    }

    .responsive-table tr {
        background: #fff;
        border: 1px solid rgba(15, 23, 42, 0.08);
        border-radius: 0.875rem;
        padding: 0.35rem 0.85rem;
        box-shadow: 0 0.125rem 0.25rem rgba(15, 23, 42, 0.04);
    }

    .responsive-table td {
        border: 0;
        padding: 0.55rem 0;
        text-align: left !important;
    }

    .responsive-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.2rem;
        font-size: 0.75rem;
        font-weight: 600;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .responsive-table td[data-label="Acoes"]::before {
        margin-bottom: 0.5rem;
    }

    .table-actions {
        justify-content: flex-start;
    }

    .table-actions .btn,
    .table-actions form {
        width: 100%;
    }

    .table-actions form .btn {
        width: 100%;
    }

    .notification-dropdown {
        width: min(360px, calc(100vw - 2rem));
    }
}

@media (max-width: 575.98px) {
    .app-content {
        padding: 0.875rem;
    }

    .modal-dialog {
        margin: 0.75rem;
    }

    .metric-value {
        font-size: 1.75rem;
    }
}
