:root {
    --brand-dark: #0f141e;
    --brand-copper: #b86b3e;
    --brand-copper-light: #d98a5b;
    --brand-gray: #f8fafc;
    --brand-text: #334155;
    --line: #dbe2ea;
    --white: #ffffff;
    --success: #047857;
    --warning: #b45309;
    --danger: #b91c1c;
    --shadow: 0 22px 60px rgba(15, 20, 30, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 17% 16%, rgba(184, 107, 62, 0.10), transparent 24%),
        radial-gradient(circle at 82% 12%, rgba(46, 64, 83, 0.13), transparent 26%),
        linear-gradient(135deg, #edf3f8 0%, #f8fafc 42%, #e5edf5 100%);
    color: var(--brand-text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 68px;
    padding: 0.65rem clamp(1rem, 3vw, 1.6rem);
    background: rgba(22, 30, 42, 0.94);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(14px);
}

.topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--white);
    text-decoration: none;
}

.brand img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(217, 138, 91, 0.35);
}

.brand strong {
    display: block;
    font-family: Montserrat, sans-serif;
    font-size: 0.98rem;
}

.brand small {
    display: block;
    margin-top: 0.18rem;
    color: #a2abb4;
    font-size: 0.78rem;
}

.environment-badge {
    border: 1px solid rgba(217, 138, 91, 0.4);
    border-radius: 999px;
    color: #ffd7bd;
    padding: 0.55rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.ghost-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--white);
    padding: 0.48rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 900;
    text-decoration: none;
}

.ghost-action:hover {
    border-color: rgba(217, 138, 91, 0.55);
    color: #ffd7bd;
}

main {
    min-height: calc(100vh - 76px);
}

.auth-view {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(340px, 0.72fr);
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: center;
    max-width: 1160px;
    margin: 0 auto;
    padding: clamp(2rem, 6vw, 4.5rem) clamp(1rem, 3vw, 2rem);
}

.auth-view::before {
    position: absolute;
    inset: clamp(1rem, 4vw, 2.5rem) auto auto 0;
    width: min(520px, 70vw);
    height: min(520px, 70vw);
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.72), transparent 66%);
    content: "";
    pointer-events: none;
    z-index: -1;
}

.auth-copy h1,
.workspace-header h2,
.section-title h3 {
    margin: 0;
    color: var(--brand-dark);
    font-family: Montserrat, sans-serif;
}

.auth-copy h1 {
    max-width: 700px;
    margin-top: 0.75rem;
    font-size: clamp(2.1rem, 4vw, 3.65rem);
    line-height: 1.02;
}

.auth-copy p {
    max-width: 610px;
    margin: 1.05rem 0 0;
    color: #475569;
    font-size: 1.06rem;
    line-height: 1.62;
}

.kicker {
    color: var(--brand-copper);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.trust-list {
    display: grid;
    gap: 0.65rem;
    margin-top: 1.35rem;
}

.trust-list span {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--brand-dark);
    font-weight: 700;
}

.trust-list i {
    color: var(--brand-copper);
}

.client-hero-panel {
    position: relative;
    display: grid;
    max-width: 620px;
    gap: 1.3rem;
    margin-top: 1.55rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(24, 34, 47, 0.96), rgba(55, 71, 88, 0.94)),
        radial-gradient(circle at top right, rgba(217, 138, 91, 0.18), transparent 35%);
    box-shadow: 0 28px 90px rgba(24, 34, 47, 0.18);
    padding: clamp(1rem, 2.5vw, 1.35rem);
    color: var(--white);
}

.client-hero-panel::after {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent 0 32%, rgba(255, 255, 255, 0.05) 32% 33%, transparent 33%),
        linear-gradient(0deg, transparent 0 48%, rgba(255, 255, 255, 0.05) 48% 49%, transparent 49%);
    background-size: 76px 76px;
    content: "";
    opacity: 0.5;
    pointer-events: none;
}

.client-hero-panel div {
    position: relative;
    z-index: 1;
}

.client-hero-panel span {
    display: block;
    color: #d9a179;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.client-hero-panel strong {
    display: block;
    max-width: 500px;
    margin-top: 0.45rem;
    font-family: Montserrat, sans-serif;
    font-size: clamp(1.1rem, 2vw, 1.45rem);
    line-height: 1.35;
}

.client-hero-steps {
    display: grid;
    grid-template-columns: 1.4fr 1fr 0.75fr;
    gap: 0.45rem;
    max-width: 420px;
}

.client-hero-steps span {
    display: block;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
}

.client-hero-steps span.active {
    background: linear-gradient(90deg, var(--brand-copper), var(--brand-copper-light));
}

.test-entry-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
}

.test-entry {
    display: grid;
    gap: 0.45rem;
    border: 1px solid rgba(219, 226, 234, 0.96);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--brand-text);
    padding: 0.9rem;
    text-align: left;
    box-shadow: 0 12px 34px rgba(24, 34, 47, 0.07);
    backdrop-filter: blur(10px);
}

.test-entry:hover {
    border-color: rgba(184, 107, 62, 0.45);
}

.test-entry-muted {
    cursor: default;
    background: #f8fafc;
}

.test-entry-muted:hover {
    border-color: var(--line);
}

.test-entry strong {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--brand-dark);
    font-family: Montserrat, sans-serif;
}

.test-entry strong i {
    color: var(--brand-copper);
}

.test-entry span {
    color: #64748b;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.55;
}

.auth-panel,
.sidebar,
.workspace,
.card-form,
.demand-card {
    border: 1px solid rgba(219, 226, 234, 0.92);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 24px 70px rgba(15, 20, 30, 0.10);
}

.auth-panel {
    border-radius: 22px;
    padding: clamp(1.05rem, 2vw, 1.35rem);
    backdrop-filter: blur(14px);
}

.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    border: 1px solid rgba(219, 226, 234, 0.9);
    border-radius: 14px;
    background: #eef3f8;
    padding: 0.35rem;
}

.segmented button {
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #64748b;
    padding: 0.75rem 1rem;
    font-weight: 900;
}

.segmented button.active {
    background: linear-gradient(135deg, #17202c, #344457);
    box-shadow: 0 10px 24px rgba(23, 32, 44, 0.18);
    color: var(--white);
}

.form-stack {
    display: grid;
    gap: 0.85rem;
    margin-top: 1.05rem;
}

label {
    display: grid;
    gap: 0.45rem;
    color: var(--brand-dark);
    font-size: 0.9rem;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--white);
    color: var(--brand-dark);
    padding: 0.78rem 0.95rem;
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(184, 107, 62, 0.8);
    box-shadow: 0 0 0 4px rgba(184, 107, 62, 0.14);
}

.primary-action,
.secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    border: 0;
    border-radius: 999px;
    padding: 0.82rem 1.1rem;
    font-weight: 900;
    text-decoration: none;
}

.primary-action {
    background: var(--brand-copper);
    color: var(--white);
}

.primary-action:hover {
    background: #9c5933;
}

.primary-action.compact {
    padding: 0.78rem 1rem;
    font-size: 0.9rem;
}

.secondary-action {
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--brand-dark);
}

.helper-text {
    margin: 0;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.55;
}

.dashboard {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 1.2rem;
    max-width: 1380px;
    margin: 0 auto;
    padding: 1rem;
}

.admin-gate {
    display: grid;
    min-height: calc(100vh - 68px);
    place-items: center;
    padding: clamp(1.25rem, 4vw, 3rem) clamp(1rem, 3vw, 1.6rem);
}

.admin-card {
    width: min(100%, 460px);
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--white);
    box-shadow: var(--shadow);
    padding: clamp(1.25rem, 4vw, 2rem);
}

.admin-card h1 {
    margin: 0.8rem 0 0;
    color: var(--brand-dark);
    font-family: Montserrat, sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.05;
}

.admin-card p {
    margin: 1rem 0 0;
    color: #64748b;
    line-height: 1.7;
}

.sidebar,
.workspace {
    border-radius: 18px;
}

.sidebar {
    position: sticky;
    top: 92px;
    align-self: start;
    display: grid;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.96);
}

.profile-card {
    display: grid;
    gap: 0.35rem;
    border-radius: 14px;
    background: linear-gradient(145deg, #17202c, #273545);
    padding: 1rem;
}

.avatar {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 14px;
    background: var(--brand-dark);
    color: var(--brand-copper-light);
    font-weight: 900;
}

.profile-card strong {
    margin-top: 0.35rem;
    color: var(--white);
}

.profile-card small {
    color: #b9c4d0;
}

.sidebar nav {
    display: grid;
    gap: 0.4rem;
}

.sidebar nav button {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #475569;
    padding: 0.85rem;
    font-weight: 800;
    text-align: left;
}

.sidebar nav button.active {
    background: #f1dfd3;
    color: #733f22;
}

.workspace {
    min-width: 0;
    padding: clamp(1rem, 3vw, 1.6rem);
    background: rgba(255, 255, 255, 0.96);
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.2rem;
}

.workspace-header h2 {
    margin-top: 0.35rem;
    font-size: clamp(1.6rem, 3vw, 2.35rem);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.metric {
    border: 1px solid rgba(219, 226, 234, 0.92);
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    padding: 1rem;
}

.metric strong {
    display: block;
    color: var(--brand-dark);
    font-family: Montserrat, sans-serif;
    font-size: 1.8rem;
}

.metric span {
    display: block;
    margin-top: 0.15rem;
    color: #64748b;
    font-size: 0.84rem;
    font-weight: 700;
}

.section-title {
    margin: 0.5rem 0 1rem;
}

.section-title h3 {
    font-size: 1.2rem;
}

.section-title p {
    margin: 0.35rem 0 0;
    color: #64748b;
    line-height: 1.6;
}

.compact-title {
    margin-top: 0;
}

.radar-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(0, 0.75fr));
    gap: 0.85rem;
}

.radar-card,
.radar-list {
    border: 1px solid rgba(219, 226, 234, 0.95);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    box-shadow: 0 18px 50px rgba(15, 20, 30, 0.08);
    padding: 1rem;
}

.radar-card {
    display: grid;
    align-content: start;
    gap: 0.55rem;
    min-height: 150px;
}

.radar-card-primary {
    background:
        linear-gradient(145deg, rgba(22, 30, 42, 0.96), rgba(47, 60, 74, 0.92)),
        radial-gradient(circle at top right, rgba(217, 138, 91, 0.24), transparent 34%);
    color: var(--white);
}

.radar-card strong {
    color: var(--brand-dark);
    font-family: Montserrat, sans-serif;
    font-size: 2rem;
    line-height: 1.05;
}

.radar-card-primary strong {
    color: var(--white);
    font-size: clamp(2rem, 5vw, 3.2rem);
}

.radar-card p,
.radar-card small {
    margin: 0;
    color: #64748b;
    line-height: 1.55;
}

.radar-card-primary p,
.radar-card-primary small {
    color: #d7dee7;
}

.radar-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 14px;
    background: #eef2f6;
    color: var(--brand-copper);
}

.radar-card.is-warning .radar-icon {
    background: #fff7ed;
    color: #c2410c;
}

.radar-card.is-stable .radar-icon {
    background: #ecfdf5;
    color: #047857;
}

.radar-card.is-clear .radar-icon {
    background: #eff6ff;
    color: #2563eb;
}

.radar-progress {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}

.radar-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand-copper), var(--brand-copper-light));
}

.radar-list {
    grid-column: 1 / -1;
}

.radar-focus-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    border-top: 1px solid var(--line);
    padding: 0.85rem 0;
}

.radar-focus-item:last-child {
    padding-bottom: 0;
}

.radar-focus-item strong {
    color: var(--brand-dark);
}

.radar-focus-item small {
    color: #64748b;
    font-weight: 700;
}

.demand-list {
    display: grid;
    gap: 0.8rem;
}

.demand-card {
    border-radius: 16px;
    padding: 1rem;
}

.demand-card header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.demand-card h4 {
    margin: 0;
    color: var(--brand-dark);
    font-family: Montserrat, sans-serif;
}

.demand-card p {
    margin: 0.55rem 0 0;
    color: #526174;
    line-height: 1.65;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.8rem;
}

.tag {
    border-radius: 999px;
    background: #eef2f6;
    color: #475569;
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 900;
}

.tag.status-open {
    background: #dcfce7;
    color: var(--success);
}

.tag.status-waiting {
    background: #fef3c7;
    color: var(--warning);
}

.tag.status-done {
    background: #e0e7ff;
    color: #3730a3;
}

.card-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    border-radius: 16px;
    padding: 1rem;
}

.card-form .wide,
.card-form button {
    grid-column: 1 / -1;
}

.crm-alert {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border: 1px solid #fed7aa;
    border-radius: 14px;
    background: #fff7ed;
    color: #9a3412;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.5;
}

.crm-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 1rem;
}

.crm-column {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f8fafc;
    padding: 0.85rem;
}

.crm-column h4 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin: 0 0 0.85rem;
    color: var(--brand-dark);
    font-family: Montserrat, sans-serif;
    font-size: 0.95rem;
}

.crm-card {
    display: grid;
    gap: 0.45rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--white);
    padding: 0.85rem;
}

.crm-card + .crm-card {
    margin-top: 0.65rem;
}

.crm-card strong {
    color: var(--brand-dark);
    font-size: 0.92rem;
}

.crm-card p {
    margin: 0;
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.5;
}

.mini-action {
    border: 1px solid rgba(184, 107, 62, 0.35);
    border-radius: 999px;
    background: #fff7ed;
    color: #9a3412;
    padding: 0.55rem 0.7rem;
    font-size: 0.76rem;
    font-weight: 900;
}

.mini-action:hover {
    background: #ffedd5;
}

.client-table-wrap {
    margin-top: 1rem;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--white);
}

.client-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.client-table th,
.client-table td {
    border-bottom: 1px solid var(--line);
    padding: 0.85rem 1rem;
    text-align: left;
}

.client-table th {
    color: var(--brand-dark);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.client-table td {
    color: #475569;
    font-size: 0.9rem;
}

.client-table tr:last-child td {
    border-bottom: 0;
}

.toast {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    max-width: min(420px, calc(100vw - 2rem));
    border-radius: 14px;
    background: var(--brand-dark);
    color: var(--white);
    padding: 0.9rem 1rem;
    box-shadow: var(--shadow);
    font-weight: 800;
}

@media (max-width: 900px) {
    .auth-view,
    .dashboard {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .crm-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .radar-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .radar-card-primary,
    .radar-list {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .topbar,
    .workspace-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-actions,
    .environment-badge,
    .ghost-action,
    .primary-action.compact {
        width: 100%;
    }

    .topbar-actions,
    .test-entry-grid,
    .metrics-grid,
    .radar-layout,
    .card-form,
    .crm-board {
        grid-template-columns: 1fr;
    }

    .radar-card-primary,
    .radar-list {
        grid-column: auto;
    }

    .radar-focus-item {
        grid-template-columns: 1fr;
    }

    .auth-view,
    .dashboard {
        padding: 1rem 0.85rem 1.3rem;
    }

    .auth-copy h1 {
        font-size: 1.86rem;
        line-height: 1.08;
    }

    .auth-copy p {
        font-size: 0.98rem;
    }

    .client-hero-panel {
        gap: 0.8rem;
        margin-top: 1rem;
        border-radius: 18px;
        padding: 0.9rem;
    }

    .client-hero-panel strong {
        font-size: 1rem;
    }

    .test-entry-grid {
        display: none;
    }

    .auth-copy p,
    .section-title p {
        line-height: 1.55;
    }

    .workspace,
    .sidebar,
    .auth-panel {
        border-radius: 14px;
    }

    .demand-card header {
        display: grid;
    }
}
