:root {
    --bg: #edf4f6;
    --bg-soft: #f8fbfb;
    --card: rgba(255, 255, 255, 0.96);
    --ink: #2d2d30;
    --muted: #61656d;
    --line: #d8dada;
    --line-strong: #c7d3d7;
    --brand: #0494a5;
    --brand-dark: #075164;
    --brand-deep: #003347;
    --slate: #43454b;
    --success: #1f7b5f;
    --warn: #98651b;
    --danger: #a2342a;
    --shadow: 0 24px 60px rgba(7, 81, 100, 0.14);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --site-banner: url("https://d2wvwvig0d1mx7.cloudfront.net/data/org/30466/media/img/source/edit/3571919_edit.png");
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "DM Sans", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(4, 148, 165, 0.18), transparent 26%),
        radial-gradient(circle at bottom right, rgba(67, 69, 75, 0.14), transparent 22%),
        linear-gradient(180deg, #f6fbfc 0%, #edf4f6 50%, #eef2f4 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
}

.sidebar {
    position: relative;
    padding: 28px 24px;
    background:
        linear-gradient(180deg, rgba(67, 69, 75, 0.97), rgba(45, 45, 48, 0.98)),
        linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
    overflow: hidden;
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: auto -30% 6% auto;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(4, 148, 165, 0.35), transparent 70%);
    pointer-events: none;
}

.sidebar-top,
.sidebar-nav,
.sidebar-footer {
    position: relative;
    z-index: 1;
}

.brand-lockup {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
}

.brand-logo-wrap {
    width: fit-content;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 18px;
    padding: 14px 18px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.brand-logo-wrap img {
    width: min(210px, 100%);
}

.brand-copy strong {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.1;
}

.brand-kicker {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--brand-dark);
}

.sidebar .brand-kicker,
.auth-hero .brand-kicker {
    color: rgba(255, 255, 255, 0.78);
}

.sidebar-intro,
.sidebar-promo p,
.sidebar-footer {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.sidebar-intro {
    margin: 0 0 18px;
}

.sidebar-promo {
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(4, 148, 165, 0.18), rgba(255, 255, 255, 0.03));
}

.sidebar-promo-title {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 700;
    margin-bottom: 10px;
    color: #ffffff;
}

.sidebar-promo p {
    margin: 0;
}

.sidebar-nav {
    display: grid;
    gap: 10px;
}

.sidebar-nav a {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.82);
    font-weight: 600;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.is-active {
    transform: translateX(2px);
    color: #ffffff;
    border-color: rgba(4, 148, 165, 0.7);
    background: linear-gradient(180deg, rgba(4, 148, 165, 0.24), rgba(7, 81, 100, 0.24));
}

.sidebar-footer {
    display: grid;
    gap: 10px;
    font-size: 0.95rem;
}

.ghost-link {
    color: #ffffff;
    opacity: 0.9;
}

.ghost-link:hover {
    opacity: 1;
}

.content {
    padding: 28px clamp(20px, 3vw, 42px) 40px;
}

.content-login {
    display: grid;
    place-items: center;
    padding: 30px 22px;
}

.content-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 24px;
    padding: 14px 18px;
    border: 1px solid rgba(4, 148, 165, 0.16);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(10px);
    box-shadow: 0 12px 30px rgba(4, 51, 71, 0.06);
}

.topbar-kicker {
    display: block;
    margin-bottom: 4px;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--brand-dark);
}

.topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(4, 148, 165, 0.08);
    color: var(--brand-dark);
    font-weight: 700;
}

.auth-layout {
    width: min(1180px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 440px);
    gap: 28px;
    align-items: stretch;
}

.auth-hero,
.login-card,
.panel,
.metric-card {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.auth-hero {
    position: relative;
    min-height: 580px;
    padding: 42px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background:
        linear-gradient(135deg, rgba(7, 81, 100, 0.88), rgba(45, 45, 48, 0.78)),
        var(--site-banner) center center / cover no-repeat;
    color: #ffffff;
}

.auth-hero::before {
    content: "";
    position: absolute;
    inset: 24px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: calc(var(--radius-xl) - 8px);
}

.auth-hero > * {
    position: relative;
    z-index: 1;
}

.auth-hero h2 {
    margin: 14px 0 14px;
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    line-height: 1.06;
    max-width: 12ch;
}

.auth-hero p {
    margin: 0 0 20px;
    max-width: 620px;
    color: rgba(255, 255, 255, 0.84);
    line-height: 1.65;
}

.auth-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.auth-chip {
    display: inline-flex;
    align-items: center;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    font-weight: 600;
}

.auth-note {
    width: fit-content;
    max-width: 100%;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.92);
}

.login-card {
    width: 100%;
    padding: 34px;
    border: 1px solid rgba(4, 148, 165, 0.12);
    background: var(--card);
}

.login-logo {
    width: min(220px, 100%);
    padding: 12px 16px;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, #f6fbfc);
    border: 1px solid rgba(4, 148, 165, 0.16);
    margin-bottom: 22px;
}

.login-card h2 {
    margin: 10px 0 10px;
    font-size: 2rem;
    line-height: 1.1;
}

.login-card p {
    margin: 0 0 22px;
    color: var(--muted);
    line-height: 1.6;
}

.page-head {
    position: relative;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding: 28px;
    border: 1px solid rgba(4, 148, 165, 0.16);
    border-radius: var(--radius-xl);
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.98), rgba(232, 244, 247, 0.94));
    box-shadow: var(--shadow);
    overflow: hidden;
}

.page-head::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 6px;
    background: linear-gradient(90deg, var(--brand) 0%, var(--brand-dark) 100%);
}

.page-head.compact {
    align-items: center;
}

.page-head h2 {
    margin: 8px 0 10px;
    font-size: clamp(2rem, 3vw, 2.8rem);
    line-height: 1.05;
}

.page-head p {
    margin: 0;
    max-width: 820px;
    color: var(--muted);
    line-height: 1.65;
}

.page-actions,
.form-actions,
.action-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.button,
button {
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 14px;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    box-shadow: 0 12px 24px rgba(4, 148, 165, 0.22);
}

.button:hover,
button:hover {
    transform: translateY(-1px);
    filter: saturate(1.04);
}

.button.secondary {
    background: linear-gradient(180deg, var(--slate) 0%, #2d2d30 100%);
    box-shadow: 0 12px 24px rgba(67, 69, 75, 0.18);
}

.filter-bar,
.form-grid {
    display: grid;
    gap: 14px;
}

.filter-bar {
    grid-template-columns: minmax(240px, 1fr) 220px 132px;
    margin-bottom: 18px;
}

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

.form-grid.single-column {
    grid-template-columns: 1fr;
}

.form-grid label,
.milestone-box {
    display: grid;
    gap: 8px;
    font-size: 0.95rem;
}

.form-grid label span {
    color: var(--muted);
    font-weight: 700;
}

.full {
    grid-column: 1 / -1;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(4, 148, 165, 0.7);
    box-shadow: 0 0 0 4px rgba(4, 148, 165, 0.12);
}

textarea {
    resize: vertical;
}

.milestone-box {
    align-self: end;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(4, 148, 165, 0.15);
    background: linear-gradient(135deg, rgba(4, 148, 165, 0.08), rgba(7, 81, 100, 0.04));
}

.milestone-head {
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--brand-dark);
    font-weight: 800;
}

.milestone-box p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.card-grid {
    display: grid;
    gap: 18px;
}

.metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 22px;
}

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

.metric-card {
    position: relative;
    padding: 24px;
    overflow: hidden;
    border: 1px solid rgba(4, 148, 165, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(236, 246, 248, 0.9));
}

.metric-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
}

.metric-card span {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.94rem;
}

.metric-card strong {
    font-size: 2.3rem;
    line-height: 1;
}

.panel {
    padding: 22px;
    border: 1px solid rgba(4, 148, 165, 0.12);
    background: var(--card);
}

.form-panel {
    padding: 24px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.panel-head h3 {
    margin: 0;
    font-size: 1.2rem;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(216, 218, 218, 0.9);
    text-align: left;
    vertical-align: top;
}

th {
    background: rgba(4, 148, 165, 0.06);
    color: var(--brand-dark);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 800;
}

tbody tr:hover td {
    background: rgba(4, 148, 165, 0.03);
}

.status {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    text-transform: uppercase;
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.status-active,
.status-converted {
    background: rgba(31, 123, 95, 0.12);
    color: var(--success);
}

.status-closed,
.status-contacted {
    background: rgba(152, 101, 27, 0.12);
    color: var(--warn);
}

.status-archived {
    background: rgba(67, 69, 75, 0.12);
    color: var(--slate);
}

.status-new {
    background: rgba(4, 148, 165, 0.12);
    color: var(--brand-dark);
}

.notes-list {
    display: grid;
    gap: 12px;
}

.note-card {
    border: 1px solid rgba(4, 148, 165, 0.12);
    border-radius: 18px;
    padding: 16px;
    background: linear-gradient(180deg, #ffffff, #f9fcfc);
}

.note-card p {
    margin: 8px 0 0;
    white-space: pre-wrap;
    line-height: 1.6;
}

.note-meta,
.muted {
    color: var(--muted);
}

.flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.flash {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid transparent;
}

.flash-success {
    background: rgba(31, 123, 95, 0.12);
    border-color: rgba(31, 123, 95, 0.18);
    color: #175c46;
}

.flash-error {
    background: rgba(162, 52, 42, 0.1);
    border-color: rgba(162, 52, 42, 0.16);
    color: var(--danger);
}

@media (max-width: 1200px) {
    .auth-layout {
        grid-template-columns: 1fr;
    }

    .auth-hero {
        min-height: 420px;
    }
}

@media (max-width: 1100px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        padding: 24px;
    }

    .metrics-grid,
    .two-up,
    .form-grid.two-column,
    .filter-bar {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 24px;
    }

    .page-head {
        align-items: start;
        flex-direction: column;
    }
}

@media (max-width: 720px) {
    .content-topbar {
        flex-direction: column;
        align-items: start;
    }

    .auth-hero,
    .login-card,
    .page-head,
    .panel,
    .metric-card {
        border-radius: 22px;
    }

    .auth-hero {
        padding: 26px;
    }

    .login-card,
    .panel,
    .form-panel {
        padding: 20px;
    }

    .page-head {
        padding: 22px;
    }

    .metric-card {
        padding: 20px;
    }
}

