/* AMPDO - identidade visual (#0A7355) */

:root,
[data-bs-theme='light'] {
    --bs-primary: #0A7355;
    --bs-primary-rgb: 10, 115, 85;
    --bs-primary-text-emphasis: #064a38;
    --bs-primary-bg-subtle: #e7f3ef;
    --bs-primary-border-subtle: #b8dcd0;
    --bs-link-color: #0A7355;
    --bs-link-hover-color: #085a44;
    --bs-focus-ring-color: rgba(10, 115, 85, 0.25);
}

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #0A7355;
    --bs-btn-border-color: #0A7355;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #086548;
    --bs-btn-hover-border-color: #075c42;
    --bs-btn-focus-shadow-rgb: 10, 115, 85;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #075a40;
    --bs-btn-active-border-color: #064a38;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #0A7355;
    --bs-btn-disabled-border-color: #0A7355;
}

.btn-outline-primary {
    --bs-btn-color: #0A7355;
    --bs-btn-border-color: #0A7355;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #0A7355;
    --bs-btn-hover-border-color: #0A7355;
    --bs-btn-focus-shadow-rgb: 10, 115, 85;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #086548;
    --bs-btn-active-border-color: #075c42;
    --bs-btn-disabled-color: #0A7355;
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: #0A7355;
}

.bg-primary {
    background-color: #0A7355 !important;
}

.navbar.bg-primary {
    background-color: #0A7355 !important;
}

.text-primary {
    color: #0A7355 !important;
}

.border-primary {
    border-color: #0A7355 !important;
}

.badge.bg-primary {
    background-color: #0A7355 !important;
}

.form-check-input:checked {
    background-color: #0A7355;
    border-color: #0A7355;
}

.form-check-input:focus {
    border-color: #3d9a7f;
    box-shadow: 0 0 0 0.25rem rgba(10, 115, 85, 0.25);
}

.form-control:focus,
.form-select:focus {
    border-color: #3d9a7f;
    box-shadow: 0 0 0 0.25rem rgba(10, 115, 85, 0.25);
}

.page-link {
    color: #0A7355;
}

.page-item.active .page-link {
    background-color: #0A7355;
    border-color: #0A7355;
}

.login-page {
    min-height: 100vh;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 18vh 8% 8vh;
}

.login-card {
    width: 100%;
    max-width: 420px;
}

.system-logo-nav {
    height: 36px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}

.system-logo-login {
    max-height: 80px;
    max-width: 100%;
    object-fit: contain;
}

.system-logo-preview {
    max-height: 120px;
    max-width: 280px;
    object-fit: contain;
}

.navbar-dark .dropdown-menu {
    border: 0;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.navbar-user-panel {
    margin-left: auto;
}

.navbar-user-info {
    max-width: 220px;
}

.page-card {
    border: 0;
}

.page-card .dt-container {
    margin-top: 0.25rem;
}

.page-card .dt-search input,
.page-card .dt-length select {
    margin-left: 0.35rem;
}

.page-card table.dataTable thead th {
    border-bottom-width: 1px;
}

.table-actions .btn + .btn {
    margin-left: 0.25rem;
}

.permission-matrix .form-check-input {
    width: 1.1rem;
    height: 1.1rem;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.app-topbar .container-fluid {
    min-height: 56px;
}

.app-topbar .navbar-brand {
    margin-right: 0;
    min-width: 0;
}

.app-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

.app-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #dee2e6;
    transition: width 0.22s ease;
    overflow: hidden;
}

.app-sidebar-inner {
    width: 260px;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    padding: 0.75rem 0 1.5rem;
}

body.sidebar-collapsed .app-sidebar {
    width: 0;
    border-right-width: 0;
}

.app-content {
    flex: 1;
    min-width: 0;
    background: #f8f9fa;
}

.app-main {
    max-width: 100%;
}

.sidebar-toggle-btn {
    line-height: 1;
    padding: 0.3rem 0.55rem;
}

.sidebar-toggle-icon {
    display: inline-block;
    width: 14px;
    height: 2px;
    background: currentColor;
    box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
    vertical-align: middle;
}

.sidebar-tree {
    width: 100%;
}

.sidebar-menu,
.sidebar-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.sidebar-menu-item {
    display: block;
    width: 100%;
    border-bottom: 1px solid #e9eef3;
}

.sidebar-menu-item:last-child {
    border-bottom: 0;
}

.sidebar-menu-link,
.sidebar-menu-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 1rem;
    color: #334155;
    text-decoration: none;
    font-size: 0.925rem;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
    border: 0;
    background: transparent;
    text-align: left;
    border-left: 3px solid transparent;
}

.sidebar-menu-link {
    font-weight: 600;
}

.sidebar-menu-toggle {
    justify-content: space-between;
    gap: 0.75rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
}

.sidebar-menu-toggle-label {
    flex: 1;
    min-width: 0;
}

.sidebar-menu-toggle-icon {
    flex-shrink: 0;
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-top: -0.1rem;
}

.sidebar-menu-toggle.collapsed .sidebar-menu-toggle-icon {
    transform: rotate(-45deg);
    margin-top: 0.1rem;
}

.sidebar-menu-link:hover,
.sidebar-menu-toggle:hover {
    background: #f1f5f9;
    color: #0A7355;
}

.sidebar-menu-link.is-active,
.sidebar-menu-link-sub.is-active {
    background: #e7f3ef;
    color: #0A7355;
    border-left-color: #0A7355;
    font-weight: 600;
}

.sidebar-submenu {
    background: #f8fafc;
    border-top: 1px solid #e9eef3;
}

.sidebar-menu-item-sub {
    border-bottom: 1px solid #edf2f7;
}

.sidebar-menu-item-sub:last-child {
    border-bottom: 0;
}

.sidebar-menu-link-sub {
    padding-left: 1.75rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.sidebar-menu-item-group > .sidebar-menu-toggle.is-active,
.sidebar-menu-item-group:has(.sidebar-menu-link-sub.is-active) > .sidebar-menu-toggle {
    color: #0A7355;
    background: #f3faf7;
    border-left-color: #0A7355;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        top: 56px;
        left: 0;
        bottom: 0;
        z-index: 1040;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.12);
    }

    body.sidebar-collapsed .app-sidebar {
        width: 0;
    }
}
