@charset "UTF-8";
@import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback");
@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css");
@import url("https://cdn.jsdelivr.net/npm/admin-lte@3.2/dist/css/adminlte.min.css");

/* ==========================================================================
   MOCITEC Admin Area — Common Styles & Brand Override
   Mirrors the PHP AdminLTE 3.2 theme with MOCITEC Brand Colors.
   Register: "A Mesa de Controle da MOCITEC"
   ========================================================================== */

:root {
    --mocitec-primary: #336c46;
    --mocitec-primary-hover: #2a5a3a;
    --mocitec-primary-active: #22482f;
    --mocitec-primary-dark: #0d3318;
    --mocitec-primary-light: #e8f5ec;
    --mocitec-primary-rgb: 51, 108, 70;

    --main-color: #336c46;
    --main-color-dark: #0d3318;
    --main-color-light: #e8f5ec;
    --main-color-hover: #2a5a3a;
    --secondary-color: #c0392b;
    --secondary-color-light: #ff6b6e;
    --secondary-color-hover: #962d22;

    --font-body: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --text-color: #212529;
    --text-color-muted: #6c757d;

    --border-color: #dee2e6;
    --border-color-light: #f1f3f5;
    --bg-hover: #f8f9fa;
}

/* Base link styling */
a {
    color: var(--mocitec-primary);
}

a:hover {
    color: var(--mocitec-primary-active);
}

a.text-danger,
a.text-success,
a.text-warning,
a.text-info,
a.text-muted,
a.text-white,
a.dropdown-item,
a.nav-link,
a.brand-link,
a.page-link {
    color: inherit;
}

/* Buttons */
.btn-primary {
    background-color: var(--mocitec-primary);
    border-color: var(--mocitec-primary);
    color: var(--mocitec-primary-light);
}

.btn-primary:hover {
    background-color: var(--mocitec-primary-hover);
    border-color: var(--mocitec-primary-hover);
    color: #ffffff;
}

.btn-primary:focus,
.btn-primary.focus {
    box-shadow: 0 0 0 0.2rem rgb(var(--mocitec-primary-rgb) / 0.5);
}

.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active,
.show > .btn-primary.dropdown-toggle {
    background-color: var(--mocitec-primary-active);
    border-color: var(--mocitec-primary-active);
}

.btn-primary.disabled,
.btn-primary:disabled {
    background-color: var(--mocitec-primary);
    border-color: var(--mocitec-primary);
}

.btn-outline-primary {
    color: var(--mocitec-primary);
    border-color: var(--mocitec-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:not(:disabled):not(.disabled):active,
.btn-outline-primary:not(:disabled):not(.disabled).active,
.show > .btn-outline-primary.dropdown-toggle {
    background-color: var(--mocitec-primary);
    border-color: var(--mocitec-primary);
    color: var(--mocitec-primary-light);
}

.btn-outline-primary:focus,
.btn-outline-primary.focus {
    box-shadow: 0 0 0 0.2rem rgb(var(--mocitec-primary-rgb) / 0.5);
}

.btn-link {
    color: var(--mocitec-primary);
}

.btn-link:hover {
    color: var(--mocitec-primary-active);
}

/* Surfaces & Badges */
body .bg-primary,
body .bg-primary.small-box,
body .badge-primary,
body .progress-bar {
    background-color: var(--mocitec-primary);
    color: var(--mocitec-primary-light);
}

body .text-primary {
    color: var(--mocitec-primary);
}

body .border-primary {
    border-color: var(--mocitec-primary);
}

body a.bg-primary:hover,
body a.bg-primary:focus,
body button.bg-primary:hover,
body button.bg-primary:focus {
    background-color: var(--mocitec-primary-active);
}

/* Alerts */
.alert-primary {
    color: var(--mocitec-primary-dark);
    background-color: var(--mocitec-primary-light);
    border-color: rgb(var(--mocitec-primary-rgb) / 0.3);
}

/* Cards */
body .card-primary:not(.card-outline) > .card-header {
    background-color: var(--mocitec-primary);
    border-bottom: 0;
    color: var(--mocitec-primary-light);
}

body .card-primary:not(.card-outline) > .card-header a {
    color: var(--mocitec-primary-light);
}

body .card-primary.card-outline {
    border-top: 3px solid var(--mocitec-primary);
}

body .card-success:not(.card-outline) > .card-header {
    background-color: var(--mocitec-primary);
    border-bottom: 0;
    color: #ffffff;
}

body .card-success.card-outline {
    border-top: 3px solid var(--mocitec-primary);
}

body .card-outline-tabs > .card-header a.active {
    border-top: 3px solid var(--mocitec-primary);
    color: var(--mocitec-primary);
}

/* Sidebar navigation active item */
body .sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active,
body .sidebar-light-primary .nav-sidebar > .nav-item > .nav-link.active,
body .nav-sidebar > .nav-item > .nav-link.active,
body .nav-pills .nav-link.active,
body .nav-pills .show > .nav-link {
    background-color: var(--mocitec-primary);
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Treeview behavior */
.nav-sidebar .has-treeview > .nav-treeview {
    display: none;
    list-style: none;
    padding-left: 0.5rem;
}

.nav-sidebar .has-treeview.menu-open > .nav-treeview {
    display: block;
}

.nav-sidebar .has-treeview > a.nav-link > p > .right,
.nav-sidebar .has-treeview > a.nav-link > p > i.right {
    position: absolute;
    right: 1rem;
    top: 0.7rem;
    transition: transform 0.2s ease-in-out;
}

.nav-sidebar .has-treeview.menu-open > a.nav-link > p > .right,
.nav-sidebar .has-treeview.menu-open > a.nav-link > p > i.right {
    transform: rotate(-90deg);
}

/* Pagination */
body .page-item.active .page-link {
    background-color: var(--mocitec-primary);
    border-color: var(--mocitec-primary);
    color: #ffffff;
}

body .page-link {
    color: var(--mocitec-primary);
}

body .page-link:hover {
    color: var(--mocitec-primary-active);
}

/* Form controls */
.form-control:focus,
.custom-select:focus,
.form-control-navbar:focus {
    border-color: rgb(var(--mocitec-primary-rgb) / 0.55);
    box-shadow: 0 0 0 0.2rem rgb(var(--mocitec-primary-rgb) / 0.25);
}

.custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--mocitec-primary);
    border-color: var(--mocitec-primary);
}

.custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 0.2rem rgb(var(--mocitec-primary-rgb) / 0.25);
}

.custom-control-input:focus:not(:checked) ~ .custom-control-label::before {
    border-color: rgb(var(--mocitec-primary-rgb) / 0.55);
}

/* Focus rings (WCAG AA) */
.btn:focus-visible,
.nav-link:focus-visible,
.page-link:focus-visible {
    outline: 2px solid var(--mocitec-primary);
    outline-offset: 2px;
}

/* ==========================================================================
   Modals — Elevated MOCITEC Craft Design
   Register: "A Mesa de Controle da MOCITEC"
   ========================================================================== */

body .modal:not(.show) {
    display: none;
    pointer-events: none;
}

body .modal {
    pointer-events: none;
}

body .modal.show {
    display: block;
    pointer-events: auto;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    overflow-y: auto;
    animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

body .modal .modal-dialog {
    margin: 2.25rem auto;
    position: relative;
    pointer-events: auto;
    animation: modalSlideDown 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

body .modal .modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #ffffff;
    background-clip: padding-box;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-top: 4px solid var(--mocitec-primary, #336c46);
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.04);
    outline: 0;
    overflow: hidden;
}

body .modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.75rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

body .modal .modal-header .modal-title,
body .modal .modal-header h3.modal-title,
body .modal .modal-header h4.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.015em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

body .modal .modal-header .modal-title i {
    color: var(--mocitec-primary, #336c46);
    font-size: 1.15rem;
}

body .modal-close,
body .modal .modal-header .close,
body .modal .modal-header .modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin: 0;
    opacity: 1;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

body .modal-close:hover,
body .modal .modal-header .close:hover,
body .modal .modal-header .modal-close:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
    transform: rotate(90deg);
}

body .modal .modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1.75rem;
    color: #1e293b;
    font-size: 0.95rem;
    line-height: 1.5;
}

body .modal .modal-body label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #475569;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

body .modal .modal-body .form-control,
body .modal .modal-body .custom-select {
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    padding: 0.5rem 0.75rem;
    font-size: 0.925rem;
    color: #1e293b;
    background-color: #ffffff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

body .modal .modal-body .form-control:focus,
body .modal .modal-body .custom-select:focus {
    border-color: var(--mocitec-primary, #336c46);
    box-shadow: 0 0 0 3px rgba(51, 108, 70, 0.18);
    outline: none;
}

body .modal .modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem 1.75rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    gap: 12px;
}

body .modal .modal-footer.justify-content-between {
    justify-content: space-between;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideDown {
    from {
        opacity: 0;
        transform: translateY(-24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 576px) {
    body .modal .modal-dialog {
        margin: 0.75rem auto;
        width: calc(100% - 1.5rem);
    }
    body .modal .modal-header {
        padding: 1rem 1.25rem;
    }
    body .modal .modal-body {
        padding: 1.25rem;
    }
    body .modal .modal-footer {
        padding: 0.75rem 1.25rem;
    }
}

/* ==========================================================================
   Toasts — Status Communication & Feedback System
   ========================================================================== */

.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: calc(100vw - 48px);
}

body .toast-container .toast,
body .toast {
    position: relative;
    box-sizing: border-box;
    -ms-flex-preferred-size: auto;
    flex-basis: auto;
    flex-grow: 0;
    flex-shrink: 0;
    height: auto;
    min-height: 0;
    width: 380px;
    min-width: 280px;
    max-width: 440px;
    margin: 0;
    padding: 14px 16px;
    border-radius: 10px;
    background: #ffffff;
    color: #1e293b;
    box-shadow: 0 14px 30px -4px rgba(15, 23, 42, 0.18), 0 4px 10px -2px rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    pointer-events: auto;
    font-size: 0.925rem;
    line-height: 1.45;
    opacity: 1;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-left: 5px solid #64748b;
    overflow: hidden;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

body .toast-container .toast:not(:last-child) {
    margin-bottom: 0;
}

body .toast-container .toast.toast-dismissing {
    opacity: 0;
    transform: translateX(100%);
}

body .toast-container .toast .toast-icon-wrap {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-top: 1px;
}

body .toast-container .toast.toast-success {
    border-left-color: var(--mocitec-primary, #336c46);
}
body .toast-container .toast.toast-success .toast-icon-wrap {
    background: rgba(51, 108, 70, 0.12);
    color: var(--mocitec-primary, #336c46);
}

body .toast-container .toast.toast-error {
    border-left-color: var(--secondary-color, #c0392b);
}
body .toast-container .toast.toast-error .toast-icon-wrap {
    background: rgba(192, 57, 43, 0.12);
    color: var(--secondary-color, #c0392b);
}

body .toast-container .toast.toast-warning {
    border-left-color: #d97706;
}
body .toast-container .toast.toast-warning .toast-icon-wrap {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

body .toast-container .toast.toast-info {
    border-left-color: #0284c7;
}
body .toast-container .toast.toast-info .toast-icon-wrap {
    background: rgba(14, 165, 233, 0.12);
    color: #0284c7;
}

body .toast-container .toast .toast-content {
    flex: 1;
    min-width: 0;
}

body .toast-container .toast .toast-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
    margin-bottom: 2px;
    line-height: 1.3;
}

body .toast-container .toast .toast-message {
    font-size: 0.85rem;
    color: #475569;
    word-break: break-word;
    background: transparent;
    padding: 0;
    box-shadow: none;
    animation: none;
    line-height: 1.4;
}

body .toast-container .toast .toast-close {
    background: transparent;
    border: 0;
    color: #94a3b8;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0;
    width: 26px;
    height: 26px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s ease, background 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -2px;
    margin-right: -4px;
    flex-shrink: 0;
}

body .toast-container .toast .toast-close:hover {
    color: #0f172a;
    background: #f1f5f9;
}

body .toast-container .toast .toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: rgba(0, 0, 0, 0.08);
}
body .toast-container .toast.toast-success .toast-progress {
    background: var(--mocitec-primary, #336c46);
}
body .toast-container .toast.toast-error .toast-progress {
    background: var(--secondary-color, #c0392b);
}
body .toast-container .toast.toast-warning .toast-progress {
    background: #d97706;
}
body .toast-container .toast.toast-info .toast-progress {
    background: #0284c7;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(40px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

@media (prefers-reduced-motion: reduce) {
    body .modal.show,
    body .modal .modal-dialog,
    body .toast-container .toast {
        animation: none;
        transition: none;
    }
    body .toast-container .toast .toast-progress {
        display: none;
    }
}

/* Dashboard Hero Strip & KPIs (Identical to legacy home.php) */
.hero-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
    margin-bottom: 1rem;
}

.hero-kpi {
    background: var(--mocitec-primary, #336c46);
    color: var(--mocitec-primary-light, #e8f5ec);
    border-radius: .375rem;
    padding: .9rem 1.1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 0 1px rgba(0, 0, 0, .125), 0 1px 3px rgba(0, 0, 0, .2);
}

.hero-kpi .hero-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

.hero-kpi .hero-label {
    font-size: .85rem;
    opacity: .92;
}

.hero-kpi.hero-kpi-muted {
    background: #ffffff;
    color: var(--text-color, #212529);
    border: 1px solid #dee2e6;
}

.hero-kpi.hero-kpi-danger {
    background: #dc3545;
    color: #ffffff;
}

.coverage-banner {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .75rem 1rem;
    border-radius: .375rem;
    margin-bottom: 1rem;
    font-size: .95rem;
}

.coverage-banner .coverage-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.coverage-banner.coverage-ok {
    background: #e8f5ec;
    color: #0d3318;
    border: 1px solid rgba(51, 108, 70, .35);
}

.coverage-banner.coverage-risk {
    background: #f9e6e3;
    color: #7d251b;
    border: 1px solid rgba(192, 57, 43, .4);
}

.coverage-banner .coverage-list {
    font-weight: 600;
}

@media (max-width: 991px) {
    .hero-strip {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .hero-strip {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Admin shell — brand mark, user panel and logout (shared by every page)
   ========================================================================== */

.biofisqui-brand-mark {
    display: inline-flex;
    width: 2.0625rem;
    height: 2.0625rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    background-color: var(--mocitec-primary);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}

.user-image-placeholder {
    display: inline-flex;
    width: 2.125rem;
    height: 2.125rem;
    align-items: center;
    justify-content: center;
    color: #fff;
    background-color: #6c757d;
}

.sidebar-logout {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.sidebar-logout:hover,
.sidebar-logout:focus {
    color: inherit;
}

/* Keep logout forms transparent to the shell layout so their buttons render
   exactly like the plain navigation links of the reference admin. */
.main-sidebar .nav-sidebar > .nav-item > form,
.main-header .navbar-nav > .nav-item > form {
    display: contents;
}
