@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700&display=swap');

:root {
    --primary: #0ea5e9;
    --dark: #0f172a;
    --surface: #ffffff;
    --muted: #6b7280;
    --chat-incoming: #eef2ff;
    --chat-outgoing: #dbeafe;
}

html, body {
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    background: #f7fbff;
    color: var(--dark);
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: row;
    background: #f7fbff;
}

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #0f172a 0%, #0ea5e9 100%);
    color: #fff;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.top-row {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e9f2;
    position: sticky;
    top: 0;
    z-index: 2;
    height: 80px;
    min-height: 80px;
    align-items: center;
}

.content {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding-top: 0.5rem;
}

@media (max-width: 768px) {
    .page {
        flex-direction: column;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
    }
}

.nav-wrapper {
    height: 100%;
}

.brand {
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    height: 80px;
    min-height: 80px;
    padding: 0.9rem 1.25rem;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
}

.nav-scrollable {
    padding-top: 0.75rem;
}

.navbar-toggler {
    appearance: none;
    cursor: pointer;
    width: 3rem;
    height: 2.3rem;
    color: white;
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.12);
    background-image:
        linear-gradient(#ffffff, #ffffff),
        linear-gradient(#ffffff, #ffffff),
        linear-gradient(#ffffff, #ffffff);
    background-repeat: no-repeat;
    background-position:
        center calc(50% - 6px),
        center,
        center calc(50% + 6px);
    background-size:
        60% 2px,
        60% 2px,
        60% 2px;
}

.navbar-toggler:checked {
    background-color: rgba(255, 255, 255, 0.32);
}

.nav-item {
    font-size: 0.95rem;
    padding-bottom: 0.35rem;
}

.nav-item .nav-link {
    color: rgba(255, 255, 255, 0.86);
    border-radius: 10px;
    height: 3rem;
    display: flex;
    align-items: center;
}

.nav-item .nav-link.active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-weight: 600;
}

.nav-item .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-scrollable {
    display: none;
}

.navbar-toggler:checked ~ .nav-scrollable {
    display: block;
}

@media (min-width: 768px) {
    .navbar-toggler {
        display: none;
    }

    .nav-scrollable {
        display: block;
        height: calc(100vh - 96px);
        overflow-y: auto;
    }
}

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

.btn-primary {
    color: #fff;
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    filter: brightness(0.95);
    color: #fff;
}

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

.btn-outline-primary:hover {
    background-color: var(--primary);
    color: #fff;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 0.15rem rgba(14, 165, 233, 0.35);
}

h1:focus {
    outline: none;
}

.validation-message {
    color: #e74c3c;
}

.blazor-error-boundary {
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    background: #b32121;
}

.blazor-error-boundary::after {
    content: "Ocorreu um erro.";
}

.hero-portal {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.16), rgba(15, 23, 42, 0.12));
    border-radius: 1.5rem;
    padding: 2.5rem;
}

.hero-card {
    border: 1px solid #e5e9f2;
}

.about-hero {
    background: linear-gradient(135deg, #0f172a 0%, #0ea5e9 100%);
    border-radius: 1.5rem;
    padding: 2.25rem;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.2);
}

.about-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.22), transparent 35%),
        radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.12), transparent 30%),
        radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.1), transparent 30%);
    pointer-events: none;
}

.about-card {
    background: #fff;
    border: 1px solid #e5e9f2;
    border-radius: 1rem;
    padding: 1.25rem 1.35rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.about-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.about-chip {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    min-width: 230px;
    backdrop-filter: blur(2px);
}

.card {
    border-radius: 1rem;
}

.card-header {
    border-top-left-radius: 1rem !important;
    border-top-right-radius: 1rem !important;
}

.card-footer {
    border-bottom-left-radius: 1rem !important;
    border-bottom-right-radius: 1rem !important;
}

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

code {
    background: #0f172a;
    color: #e0f2fe;
    padding: 0.15rem 0.35rem;
    border-radius: 0.4rem;
    font-size: 0.85rem;
}

.auth-page {
    max-width: 760px;
    margin: 0 auto;
    padding-top: 1.5rem;
}

.fluent-form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
}

.span-7 {
    grid-column: span 7;
}

.span-2 {
    grid-column: span 2;
}

.span-3 {
    grid-column: span 3;
}

.span-4 {
    grid-column: span 4;
}

.span-5 {
    grid-column: span 5;
}

.span-12 {
    grid-column: span 12;
}
.span-5 {
    grid-column: span 5;
}

.fluent-form-grid > div {
    width: 100%;
}

.fluent-form-grid fluent-combobox,
.fluent-form-grid fluent-number-field,
.fluent-form-grid fluent-date-picker,
.fluent-form-grid fluent-time-picker,
.fluent-form-grid fluent-text-field {
    width: 100%;
    display: block;
}

.fluent-form-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.form-card {
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.08);
    border: 1px solid #e5e9f2;
    background: #fff;
    width: 100%;
}

.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    align-items: flex-start;
}

.chat-item {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.chat-thread .align-self-end {
    align-self: flex-end;
}

.chat-thread .align-self-start {
    align-self: flex-start;
}

.chat-thread .align-center {
    align-self: center;
}

.chat-meta {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.35rem;
}

.chat-bubble {
    padding: 0.75rem 1rem;
    border-radius: 14px;
    line-height: 1.4;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    max-width: 100%;
    word-break: break-word;
}

.chat-incoming {
    align-self: flex-start;
    background: var(--chat-incoming);
    border: 1px solid #e5e7eb;
}

.chat-outgoing {
    align-self: flex-end;
    background: var(--chat-outgoing);
    border: 1px solid #bfdbfe;
}

.chat-solicitante {
    background: #ecfdf3;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.chat-agente {
    background: #dbeafe;
    border: 1px solid #bfdbfe;
    color: #0f172a;
}

.chat-status {
    background: #f3f4f6;
    color: #6b7280;
    align-self: center;
    font-size: 0.8rem;
}

.chat-container {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 18px;
    padding: 1rem;
    border: 1px solid #e5e9f2;
    max-height: 520px;
    overflow-y: auto;
    width: 100%;
}

.conversa-card {
    border: 1px solid #e5e9f2;
    border-radius: 12px;
    padding: 1rem;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    cursor: pointer;
}

.conversa-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.detail-summary {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: flex-start;
    min-height: auto;
}

fluent-card.detail-summary::part(control) {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: flex-start;
    min-height: 0 !important;
    height: auto !important;
    padding: 1rem 1.25rem;
}

.detail-summary .summary-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.detail-summary .summary-meta {
    display: grid;
    gap: 0.2rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.summary-priority {
    justify-self: end;
    font-weight: 600;
    color: #0f172a;
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    font-size: 0.85rem;
}

.priority-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0f172a;
    border: 1px solid #bae6fd;
    font-weight: 600;
}

.conversa-card {
    position: relative;
}

.right-meta {
    min-width: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
}

.detail-right-meta {
    min-width: 180px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.35rem;
}
.detail-chat .chat-thread {
    padding: 0.25rem 0.35rem;
}

.detail-chat .chat-item {
    max-width: 72%;
}

.detail-compose fluent-text-area {
    width: 100%;
}

fluent-card.detail-compose::part(control) {
    min-height: 0 !important;
    height: auto !important;
    padding: 1rem 1.25rem;
}

.detail-compose fluent-text-area,
.detail-chat fluent-text-area {
    width: 100%;
}

@media (max-width: 768px) {
    .detail-summary {
        grid-template-columns: 1fr;
    }

    .detail-chat .chat-item {
        max-width: 100%;
    }
}

.badge-soft {
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
}

.status-open { background: #e0f2fe; color: #0369a1; }
.status-pending { background: #fef9c3; color: #854d0e; }
.status-resolved { background: #dcfce7; color: #166534; }
.status-snoozed { background: #ede9fe; color: #5b21b6; }
