/**
 * Tema CIT no mesmo vermelho do Versatility.
 */
:root {
    --brand: #A72626;
    --brand-hover: #802121;
    --bs-primary: #A72626;
    --bs-primary-rgb: 167, 38, 38;
    --bs-link-color: #A72626;
    --bs-link-hover-color: #802121;
    --bs-danger: #e74c3c;
    --bs-danger-rgb: 231, 76, 60;
    --bs-font-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-font-size: 0.9375rem;
    --cit-body-bg: #f7f8fa;
    --cit-card-border: #ebecef;
    --cit-ink: #111827;
    --cit-muted: #6b7280;
}

body.cit-body {
    font-family: var(--bs-font-sans-serif);
    background-color: var(--cit-body-bg);
    color: var(--cit-ink);
    min-height: 100vh;
}

.cit-main {
    padding-top: 1.75rem;
    padding-bottom: 3rem;
}

.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-hover);
    --bs-btn-hover-border-color: var(--brand-hover);
    --bs-btn-active-bg: var(--brand-hover);
    --bs-btn-active-border-color: var(--brand-hover);
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
    --bs-btn-focus-shadow-rgb: 167, 38, 38;
}

.cit-topbar {
    background-image: linear-gradient(to right, var(--brand), var(--brand-hover));
    background-color: var(--brand);
    box-shadow: 0 8px 24px rgba(167, 38, 38, 0.22);
}

.cit-topbar-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    min-height: 76px;
    padding: 12px 28px;
}

.cit-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.cit-brand:hover {
    color: #fff;
}

.cit-brand-logo {
    display: block;
    height: 22px;
    width: auto;
}

.cit-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.28);
}

.cit-brand-text strong {
    font-size: 15px;
    font-weight: 600;
}

.cit-brand-text small {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.cit-nav-pill {
    justify-self: center;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
}

.cit-nav-pill a,
.cit-nav-mobile a {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: 999px;
    white-space: nowrap;
}

.cit-nav-pill a:hover,
.cit-nav-mobile a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}

.cit-nav-pill a.is-active,
.cit-nav-mobile a.is-active {
    color: var(--brand);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.cit-topbar-end {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cit-user {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 14px 4px 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
}

.cit-user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

.cit-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    color: var(--brand);
    font-size: 11px;
    font-weight: 700;
}

.cit-user-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.cit-user-role {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.78);
    white-space: nowrap;
}

.cit-logout {
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.08);
}

.cit-logout:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

.cit-menu-toggle {
    display: none;
    width: 36px;
    height: 36px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    background: transparent;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.cit-menu-toggle span {
    display: block;
    height: 2px;
    background: #fff;
    border-radius: 1px;
}

.cit-nav-mobile {
    display: none;
    padding: 0 16px 12px;
}

.cit-nav-mobile.show,
.cit-nav-mobile.collapsing {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

@media (max-width: 991.98px) {
    .cit-topbar-inner {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 12px 16px;
    }

    .cit-nav-pill,
    .cit-user-meta {
        display: none;
    }

    .cit-menu-toggle {
        display: inline-flex;
    }

    .cit-brand-text {
        display: none;
    }
}

/* Cartões e tabelas no estilo portal */
.cit-card {
    border: 1px solid var(--cit-card-border);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.cit-table-wrap {
    border: 1px solid var(--cit-card-border);
    border-radius: 0.5rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Login */
.cit-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem 4.5rem;
    background:
        radial-gradient(ellipse 80% 50% at 100% 0%, rgba(167, 38, 38, 0.16), transparent 55%),
        radial-gradient(ellipse 70% 45% at 0% 100%, rgba(167, 38, 38, 0.08), transparent 50%),
        var(--cit-body-bg);
}

.cit-login-card {
    width: min(420px, 100%);
    background: #fff;
    border: 1px solid var(--cit-card-border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
    padding: 2.25rem 2rem 1.5rem;
}

.cit-login-brand {
    text-align: center;
}

.cit-login-logo {
    display: block;
    height: 28px;
    width: auto;
    margin: 0 auto 1.25rem;
}

.cit-login-brand h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--cit-ink);
}

.cit-login-brand p {
    margin: 0.65rem auto 0;
    max-width: 320px;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--cit-muted);
}

.cit-login-alert {
    margin-top: 1.25rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    font-size: 0.875rem;
}

.cit-btn-microsoft {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    height: 44px;
    margin-top: 1.75rem;
    background: #fff;
    border: 1px solid #8c8c8c;
    border-radius: 8px;
    color: #3b3b3b;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
}

.cit-btn-microsoft:hover {
    background: #f3f2f1;
    color: #3b3b3b;
    border-color: #8c8c8c;
}

.cit-login-hint,
.cit-login-player {
    margin: 0.85rem 0 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--cit-muted);
}

.cit-login-player a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 500;
}

.cit-login-player a:hover {
    text-decoration: underline;
}

.cit-login-card .btn-primary {
    margin-top: 0.25rem;
}

form.form-inline-cit {
    display: inline;
}

.cit-page-title {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.cit-count {
    background: #fff;
    color: var(--brand);
    border: 1px solid var(--cit-card-border);
    font-weight: 600;
    padding: 0.45rem 0.75rem;
}

.cit-card .card-header {
    background: #fff;
    border-bottom: 1px solid var(--cit-card-border);
    font-weight: 600;
}

.cit-table-wrap .table {
    --bs-table-hover-bg: #faf7f7;
}

.cit-table-wrap thead th {
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--cit-muted);
    font-weight: 600;
    border-bottom-width: 1px;
}

.cit-row-active {
    background: #f8eaea;
}

.cit-preview {
    display: grid;
    grid-template-rows: 0fr;
    background: #0f172a;
    transition: grid-template-rows 0.28s ease;
}

.cit-preview.is-open {
    grid-template-rows: 1fr;
}

.cit-preview-frame {
    min-height: 0;
    overflow: hidden;
}

.cit-preview iframe {
    display: block;
    width: 100%;
    height: min(70vh, 520px);
    border: 0;
    background: #0f172a;
}

.cit-url {
    display: block;
    max-width: 420px;
    color: var(--cit-muted);
    font-size: 0.75rem;
}

.cit-pdf-hero h2 {
    font-weight: 600;
}

.cit-pdf-badge {
    background: #fff;
    color: var(--cit-muted);
    border: 1px solid var(--cit-card-border);
    font-weight: 600;
}

.cit-pdf-badge.is-on {
    background: #f8eaea;
    color: var(--brand);
    border-color: #f0d4d4;
}

.cit-pdf-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
    padding: 1.5rem 1rem;
    border: 1px dashed #d7dbe3;
    border-radius: 0.75rem;
    background: #fafbfc;
    text-align: center;
    cursor: pointer;
}

.cit-pdf-drop:hover,
.cit-pdf-drop:focus-within {
    border-color: var(--brand);
    background: #fff;
}

.cit-pdf-drop-title {
    font-weight: 600;
    color: var(--cit-ink);
    word-break: break-word;
}

.cit-pdf-drop-hint {
    font-size: 0.8rem;
    color: var(--cit-muted);
}

.cit-pdf-drop input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
