@import url("https://cdn.jsdelivr.net/npm/@fontsource/source-sans-3@5.2.5/latin-400.css");
@import url("https://cdn.jsdelivr.net/npm/@fontsource/source-sans-3@5.2.5/latin-600.css");
@import url("https://cdn.jsdelivr.net/npm/@fontsource/source-sans-3@5.2.5/latin-700.css");

:root {
    --bg: #f4f6f5;
    --ink: #0e1c16;
    --muted: #2c4539;
    --line: #e1e8e3;
    --card: #ffffff;
    --header: #10241c;
    --brand: #1b6b45;
    --brand-2: #124e32;
    --gold: #b5812a;
    --danger: #8d2d2d;
    --shadow: 0 1px 2px rgba(16, 36, 28, .04), 0 12px 32px rgba(16, 36, 28, .05);
    --glass: rgba(255, 255, 255, .86);
    --glass-border: rgba(255, 255, 255, .46);
}

* { box-sizing: border-box; }
html { font-size: 18px; }
img, svg, video { max-width: 100%; height: auto; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.55;
}
body.is-loading { cursor: progress; }
body.is-loading::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    z-index: 80;
    height: 3px;
    width: 35%;
    background: var(--brand);
    animation: app-load .9s ease-in-out infinite;
}
#app-content.is-fresh { animation: rise .32s cubic-bezier(.22, 1, .36, 1) both; }
a { color: #0d5c38; text-decoration-thickness: 1px; text-underline-offset: .15em; }
h1, h2, h3, h4, h5, h6 { letter-spacing: -.02em; color: #0b1611; }
.text-muted { color: var(--muted) !important; }
small, .small { font-size: .92rem; color: var(--muted); }

.app-shell { min-height: 100vh; position: relative; z-index: 1; background: transparent; }
.top-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    background: transparent;
    color: var(--ink);
    border-bottom: 0;
    transition: box-shadow .22s ease;
}
.top-nav.is-scrolled { box-shadow: none; }
.top-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem 1.4rem;
    background: rgba(16, 36, 28, .55);
    backdrop-filter: blur(16px);
    color: #e7f0eb;
}
.top-nav-user { display: flex; align-items: center; gap: .7rem; }
.user-meta { display: flex; flex-direction: column; line-height: 1.15; text-align: right; }
.user-meta strong { font-size: 1rem; font-weight: 700; color: #f7fbf8; }
.user-meta small { color: #f3ead4; font-size: .88rem; }
.brand { display: flex; gap: .7rem; align-items: center; color: inherit; text-decoration: none; }
.brand strong { display: block; font-size: .95rem; letter-spacing: .04em; }
.brand small { display: block; color: #d7b56a; letter-spacing: .12em; font-size: .68rem; font-weight: 700; }
.brand-logo {
    display: block;
    height: 58px;
    width: auto;
    max-width: min(440px, 72vw);
    box-sizing: content-box;
    background: #fff;
    border-radius: 12px;
    padding: 7px 16px;
    object-fit: contain;
}
.user-chip {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #1b6b45;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: .82rem;
    font-weight: 700;
    flex: none;
}
#mainMenu {
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0 .85rem;
}
.top-menu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .2rem .35rem;
    max-width: 1440px;
    margin: 0 auto;
    padding: .35rem 1.5rem;
    background: transparent;
    border-bottom: 0;
}
.nav-drop { position: relative; display: flex; align-items: stretch; }
.nav-drop-toggle { background: transparent; border: 0; border-bottom: 2px solid transparent; cursor: pointer; }
.nav-caret { font-size: .68rem; margin-left: .15rem; transition: transform .18s ease; }
.nav-drop.is-open .nav-caret,
.nav-drop:hover .nav-caret { transform: rotate(180deg); }
.nav-sub {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 40;
    min-width: 240px;
    flex-direction: column;
    gap: .15rem;
    padding: .4rem;
    background: var(--glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 16px 36px rgba(16, 36, 28, .12);
}
.nav-drop:hover .nav-sub,
.nav-drop:focus-within .nav-sub,
.nav-drop.is-open .nav-sub { display: flex; }
.nav-sub-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .7rem;
    border-radius: 8px;
    color: #163026;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
}
.nav-sub-link i { color: var(--brand); }
.nav-sub-link:hover,
.nav-sub-link.active { background: #f3f8f5; color: var(--brand-2); }
.nav-sub-link:hover i,
.nav-sub-link.active i { color: var(--brand); }
.nav-link {
    color: #163026;
    border-radius: 0;
    padding: .75rem .9rem;
    display: flex;
    gap: .45rem;
    align-items: center;
    font-size: 1.02rem;
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    text-decoration: none;
    transition: color .18s ease, border-color .18s ease;
}
.nav-link i { color: var(--brand); font-size: 1.05rem; }
.nav-link:hover { color: var(--brand-2); }
.nav-link:hover i, .nav-link.active i { color: var(--brand); }
.nav-link.active { color: var(--brand-2); background: transparent; border-bottom-color: var(--brand); }
.btn-quiet {
    color: #e7f0eb;
    border: 1px solid rgba(231, 240, 235, .35);
    background: transparent;
}
.btn-quiet:hover { color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.5); }
.main { min-height: calc(100vh - 9rem); padding: .85rem .85rem 0; }
.content {
    padding: 1.6rem 1.5rem 2.2rem;
    max-width: 1440px;
    margin: 0 auto;
    background: rgba(255, 255, 255, .8);
    backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
}
.page-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-end; margin-bottom: 1.15rem; flex-wrap: wrap; }
.page-head h1 { font-size: 2rem; font-weight: 700; margin: 0; color: #0b1611; }
.page-head p { margin: .3rem 0 0; color: var(--muted); max-width: 62rem; font-size: 1.05rem; }
.page-head .d-flex { flex-wrap: wrap; }
.app-foot {
    padding: .9rem 1.5rem 1.2rem;
    color: #f4faf6;
    font-size: 1rem;
    text-align: center;
}
.eyebrow { margin: 0 0 .2rem; color: #8a5412; font-size: .84rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

.card-metric, .panel, .deal-card, .kanban-col, .bubble.ai, .bubble.human, .bubble.system {
    background: var(--glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
}
.panel, .card-metric { box-shadow: var(--shadow); }
.card-metric { position: relative; padding: 1rem 1.05rem 1rem 1.15rem; height: 100%; overflow: hidden; }
.card-metric::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--brand);
}
.card-metric span { color: var(--muted); font-size: .95rem; font-weight: 700; }
.card-metric strong {
    display: block;
    font-size: 1.85rem;
    color: #0b1611;
    margin-top: .3rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.03em;
}
.panel { padding: 1.05rem 1.15rem; }
.section-label { font-size: .84rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 1.2rem 0 .6rem; font-weight: 700; }

.btn { border-radius: 10px; font-weight: 600; font-size: 1rem; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: white; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-2); border-color: var(--brand-2); color: white; }
.btn-outline-secondary { border-color: #b7c7bd; color: #163026; background: rgba(255,255,255,.9); }
.btn-outline-secondary:hover { background: #f4f8f5; color: #163026; border-color: #b7c7bd; }
.form-label { font-size: 1rem; font-weight: 700; color: #163026; margin-bottom: .35rem; }
.form-control, .form-select {
    border-color: rgba(255, 255, 255, .7);
    background-color: rgba(255, 255, 255, .92);
    border-radius: 10px;
    min-height: 46px;
    font-size: 1.05rem;
    color: var(--ink);
    transition: border-color .18s ease, box-shadow .18s ease;
}
.form-control::placeholder { color: #4d675b; }
.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(27, 107, 69, .14);
    color: var(--ink);
    background-color: #fff;
}
.alert { border: 0; border-left: 4px solid; border-radius: 12px; }
.alert-success { background: rgba(238, 246, 241, .72); color: #145c38; border-left-color: var(--brand); }
.alert-danger { background: rgba(253, 243, 243, .72); color: #7a2424; border-left-color: var(--danger); }
.alert-warning { background: rgba(251, 246, 234, .72); color: #6d5314; border-left-color: var(--gold); }
.alert-info { background: rgba(243, 247, 245, .72); color: #244036; border-left-color: #7d9186; }

.table { --bs-table-bg: transparent; --bs-table-color: var(--ink); margin-bottom: 0; color: var(--ink); font-size: 1rem; }
.table thead th {
    font-size: .84rem;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #1c3328;
    font-weight: 700;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .4);
    white-space: nowrap;
}
.table td { border-color: #eef2ef; vertical-align: middle; }
.table a { font-weight: 600; text-decoration: none; }
.table a:hover { text-decoration: underline; }
.panel > .table-responsive { margin: -.15rem -.2rem .2rem; }
form.panel .row { align-items: end; }
.table tbody tr:hover { background: rgba(255, 255, 255, .35); }
.badge-soft { background: rgba(231, 243, 236, .75); color: var(--brand-2); font-weight: 600; }
.pagination .page-link { color: var(--brand-2); border-color: var(--line); background: rgba(255, 255, 255, .55); }
.pagination .page-item.active .page-link { background: var(--brand); border-color: var(--brand); }

body.brand-bg {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    background-color: #07140f;
    background-image:
        radial-gradient(ellipse 42% 36% at 12% 8%, rgba(228, 176, 74, .55), transparent 70%),
        radial-gradient(ellipse 40% 42% at 92% 12%, rgba(62, 186, 112, .42), transparent 68%),
        radial-gradient(ellipse 46% 40% at 72% 96%, rgba(181, 129, 42, .4), transparent 70%),
        radial-gradient(ellipse 55% 45% at 50% 42%, rgba(32, 92, 62, .45), transparent 70%),
        linear-gradient(155deg, #1c4d36 0%, #0d2419 46%, #07140f 100%);
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: 140% 140%, 140% 140%, 140% 140%, 100% 100%, auto;
    animation: brand-shift 18s ease-in-out infinite;
}
body.brand-bg::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(circle at 50% 42%, #000 0%, transparent 72%);
    animation: auth-grid 22s linear infinite;
}
body.brand-bg::after {
    content: "";
    position: fixed;
    z-index: 0;
    left: 50%;
    top: 42%;
    width: min(880px, 132vw);
    height: min(880px, 132vw);
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0 62%, rgba(228, 194, 122, .75) 78%, transparent 92%);
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
    transform: translate(-50%, -50%);
    animation: auth-spin 16s linear infinite;
    pointer-events: none;
}
.auth-stage {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    background: transparent;
}
.auth-center {
    position: relative;
    z-index: 1;
    width: min(460px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.auth-brand {
    display: flex;
    justify-content: center;
    color: #f4f8f6;
    width: 100%;
    margin: 0 0 1.05rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(27, 107, 69, .16);
}
.auth-brand small { color: #e4c27a; }
.auth-card {
    width: 100%;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, .95);
    border-radius: 22px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .42);
    padding: 1.7rem 1.9rem 1.45rem;
    animation: auth-in .7s cubic-bezier(.22, 1, .36, 1) .12s backwards;
}
.auth-card .alert {
    margin: 0 0 1rem;
    padding: .75rem .95rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.auth-card .panel {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
    animation: none;
}
.auth-card h1 { font-size: 2.2rem; font-weight: 700; margin: 0; color: #0b1611; }
.auth-lead { margin: .35rem 0 1.25rem; color: #243d32; font-size: 1.08rem; line-height: 1.45; }
.auth-field { margin-bottom: 1rem; }
.auth-field:has(.is-invalid) .invalid-feedback { display: block; }
.auth-input { position: relative; }
.auth-input > i {
    position: absolute;
    left: .95rem;
    top: 25px;
    transform: translateY(-50%);
    line-height: 1;
    color: #1b6b45;
    pointer-events: none;
}
.auth-card .form-label { color: #10281c; }
.auth-input .form-control {
    min-height: 50px;
    padding-left: 2.7rem;
    background: #fff;
    border: 1.5px solid #c3d4ca;
    color: #0e1c16;
}
.auth-input .form-control:focus { background: #fff; border-color: #1b6b45; }
.auth-input:has(.auth-toggle) .form-control { padding-right: 2.9rem; }
.auth-toggle {
    position: absolute;
    right: .4rem;
    top: 7px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #1b6b45;
    display: grid;
    place-items: center;
}
.auth-toggle:hover, .auth-toggle:focus-visible { background: #e7f3ec; color: var(--brand-2); }
.auth-submit { min-height: 50px; margin-top: .45rem; font-size: 1.08rem; box-shadow: 0 10px 22px rgba(27, 107, 69, .28); }
.auth-foot { margin: 1.15rem 0 0; text-align: center; }
.auth-foot a { font-weight: 600; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }
.auth-brand { animation: auth-in .65s cubic-bezier(.22, 1, .36, 1) backwards; }
.auth-brand .brand-logo {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: none;
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    animation: auth-mark .7s cubic-bezier(.22, 1, .36, 1) backwards;
}
.auth-card { animation: auth-in .7s cubic-bezier(.22, 1, .36, 1) .12s backwards; }
.auth-card .eyebrow,
.auth-card h1,
.auth-card .auth-lead,
.auth-card .auth-field,
.auth-card .auth-submit,
.auth-card .auth-foot {
    animation: auth-in .55s cubic-bezier(.22, 1, .36, 1) backwards;
}
.auth-card .eyebrow { animation-delay: .22s; }
.auth-card h1 { animation-delay: .28s; }
.auth-card .auth-lead { animation-delay: .34s; }
.auth-card .auth-field:nth-of-type(1) { animation-delay: .4s; }
.auth-card .auth-field:nth-of-type(2) { animation-delay: .48s; }
.auth-card .auth-submit { animation-delay: .56s; }
.auth-card .auth-foot { animation-delay: .64s; }

.public-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .85rem 1.4rem;
    background: rgba(16, 36, 28, .55);
    backdrop-filter: blur(16px);
    color: #e7f0eb;
}
.public-links { display: flex; align-items: center; gap: .9rem; }
.public-links a:not(.btn) { color: #f7fbf8; text-decoration: none; font-weight: 700; font-size: 1.05rem; }
.public-bar,
.public-wrap { position: relative; z-index: 1; }
.public-wrap {
    max-width: 860px;
    margin: 1.25rem auto;
    padding: 2rem 1rem 3rem;
    background: rgba(255, 255, 255, .8);
    backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
}
.chat-log { display: flex; flex-direction: column; gap: .7rem; margin: 1rem 0; min-height: 8rem; }
.bubble { max-width: 78%; padding: .8rem .95rem; border-radius: 14px; white-space: pre-wrap; line-height: 1.45; }
.bubble.customer { background: #e5f3eb; align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble.ai, .bubble.human, .bubble.system { border-bottom-left-radius: 4px; }
.kanban { display: flex; gap: .8rem; overflow: auto; padding-bottom: 1rem; }
.kanban-col { min-width: 260px; border-radius: 14px; padding: .75rem; }
.kanban-col h2 { font-size: 1.1rem; color: #0b1611; }
.deal-card { border-radius: 12px; padding: .75rem; margin-bottom: .6rem; transition: border-color .2s ease; }
.deal-card:hover { border-color: #b7d2c3; }

.table-responsive { max-width: 100%; -webkit-overflow-scrolling: touch; }
.pagination { flex-wrap: wrap; }
form.d-flex,
.d-flex.gap-2,
.d-flex.gap-3 { flex-wrap: wrap; }
.page-head .btn,
.page-head .d-flex { max-width: 100%; }

@media (max-width: 1199px) {
    html { font-size: 17px; }
}
@media (max-width: 991px) {
    .top-nav-bar { flex-wrap: wrap; padding: .65rem .85rem; }
    .brand { min-width: 0; }
    .brand-logo { height: 48px; max-width: 74vw; padding: 6px 12px; }
    .top-nav-user .user-meta { display: none; }
    .top-nav-user { margin-left: auto; }
    #mainMenu { padding: 0; }
    .top-menu { max-width: none; margin: 0; flex-direction: column; align-items: stretch; gap: .15rem; padding: .4rem 1.15rem .75rem; }
    .nav-drop { flex-direction: column; }
    .nav-link { border-bottom: 0; border-radius: 10px; white-space: normal; min-height: 44px; }
    .nav-sub-link { min-height: 44px; }
    .nav-link.active { background: #e7f3ec; }
    .nav-sub {
        position: static;
        min-width: 0;
        border: 0;
        box-shadow: none;
        padding: .1rem 0 .25rem 1rem;
        display: none;
    }
    .nav-drop:hover .nav-sub,
    .nav-drop:focus-within .nav-sub { display: none; }
    .nav-drop.is-open .nav-sub { display: flex; }
    .page-head { flex-direction: column; align-items: stretch; }
    .page-head .btn { width: 100%; }
    .content { padding: 1.1rem .9rem 2rem; }
    .public-bar { flex-wrap: wrap; padding: .7rem .85rem; }
    .public-links { flex-wrap: wrap; justify-content: flex-end; }
    .public-wrap { margin: .85rem .65rem; padding: 1.25rem .9rem 1.8rem; }
    .auth-stage { padding: 1rem .75rem; }
    .auth-card { padding: 1.25rem 1.05rem 1.15rem; }
    .auth-brand .brand-logo { width: 100%; height: auto; max-height: none; padding: 0; }
    .kanban-col { min-width: min(260px, 84vw); }
    .main { padding: .65rem .55rem 0; }
}
@media (max-width: 575px) {
    html { font-size: 16px; }
    .page-head h1,
    .auth-card h1 { font-size: 1.65rem; }
    .card-metric strong { font-size: 1.4rem; }
    .content { border-radius: 14px; padding: 1rem .75rem 1.5rem; }
    form.d-flex { flex-direction: column; align-items: stretch; }
    form.d-flex .form-select,
    form.d-flex .form-control,
    form.d-flex .btn { width: 100%; }
    .app-foot { padding-left: .75rem; padding-right: .75rem; }
}

@keyframes app-load {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}
@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}
@keyframes rise-side {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: none; }
}
.public-wrap > .panel { animation: rise .5s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes brand-shift {
    0%, 100% { background-position: 0% 0%, 100% 0%, 30% 100%, center, center; }
    50% { background-position: 10% 8%, 78% 12%, 48% 88%, center, center; }
}
@keyframes auth-in {
    from { opacity: 0; transform: translateY(22px); }
    to { opacity: 1; transform: none; }
}
@keyframes auth-mark {
    from { opacity: 0; transform: scale(.7); }
    to { opacity: 1; transform: none; }
}
@keyframes auth-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(228, 194, 122, .45); }
    70% { box-shadow: 0 0 0 12px rgba(228, 194, 122, 0); }
}
@keyframes auth-drift {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(36px, 24px, 0) scale(1.08); }
}
@keyframes auth-spin {
    to { transform: translate(-50%, -50%) rotate(1turn); }
}
@keyframes auth-grid {
    from { background-position: 0 0; }
    to { background-position: 48px 48px; }
}
.is-entering { animation: rise .35s cubic-bezier(.22, 1, .36, 1) both; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
