:root {
    --bg: #050914;
    --surface: #0b1222;
    --surface-2: #101a31;
    --line: rgba(136, 166, 255, 0.18);
    --text: #f7fbff;
    --muted: #9aa8c7;
    --blue: #1d8fff;
    --cyan: #38d5ff;
    --danger: #ff5470;
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 0%, rgba(29, 143, 255, 0.2), transparent 30%),
        linear-gradient(140deg, #050914 0%, #071225 52%, #050914 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

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

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 280px;
    min-height: 100vh;
    padding: 24px;
    border-right: 1px solid var(--line);
    background: rgba(5, 9, 20, 0.78);
    backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 20px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    box-shadow: 0 0 26px rgba(56, 213, 255, 0.36);
}

.nav {
    display: grid;
    gap: 8px;
}

.nav a,
.sidebar-footer a {
    color: var(--muted);
    padding: 11px 12px;
    border-radius: var(--radius);
}

.nav a:hover,
.sidebar-footer a:hover {
    color: var(--text);
    background: rgba(29, 143, 255, 0.12);
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.main {
    width: 100%;
    padding: 36px;
}

.auth-main {
    width: 100%;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(920px, 100%);
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 32px;
    align-items: center;
    padding: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(11, 18, 34, 0.82);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.login-copy h1,
.hero h1,
.page-header h1 {
    margin: 8px 0 12px;
    font-size: 44px;
    line-height: 1.06;
}

.login-copy p,
.hero p,
.page-header p,
.panel p {
    color: var(--muted);
    line-height: 1.6;
}

.eyebrow {
    color: var(--cyan);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.form,
.inline-form {
    display: grid;
    gap: 12px;
}

.inline-form {
    grid-template-columns: 1fr 1fr auto;
}

label {
    color: var(--muted);
    font-size: 13px;
}

input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(5, 9, 20, 0.72);
    color: var(--text);
    padding: 0 14px;
    font: inherit;
}

select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(5, 9, 20, 0.72);
    color: var(--text);
    padding: 12px 14px;
    font: inherit;
}

textarea {
    resize: vertical;
    line-height: 1.5;
}

button,
.button {
    min-height: 46px;
    border: 0;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--blue), #0cc9ff);
    color: #fff;
    padding: 0 18px;
    font-weight: 800;
    font: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.link-button {
    min-height: auto;
    padding: 0;
    background: transparent;
    color: var(--cyan);
    font-weight: 800;
}

.danger-link {
    color: var(--danger);
}

.button-disabled {
    cursor: default;
    color: var(--muted);
    background: rgba(154, 168, 199, 0.14);
}

.button-secondary {
    background: rgba(154, 168, 199, 0.14);
    color: var(--text);
}

.flash {
    margin-bottom: 18px;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(29, 143, 255, 0.12);
}

.flash-error {
    border-color: rgba(255, 84, 112, 0.35);
    background: rgba(255, 84, 112, 0.12);
}

.hero,
.page-header {
    max-width: 900px;
    margin-bottom: 28px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.metric-card,
.panel,
.table-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(11, 18, 34, 0.78);
}

.metric-card {
    padding: 22px;
}

.metric-card strong {
    display: block;
    font-size: 32px;
}

.metric-card span {
    color: var(--muted);
}

.panel {
    padding: 24px;
}

.panel h2 {
    margin: 0 0 8px;
}

.split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.table-panel {
    overflow: auto;
}

.table-link {
    color: var(--cyan);
    font-weight: 800;
}

.table-link-spaced {
    margin-left: 12px;
}

.table-action-form {
    display: inline-flex;
    margin-left: 12px;
}

.section-title {
    margin: 28px 0 12px;
}

.section-title h2 {
    margin: 0 0 6px;
}

.section-title p {
    margin: 0;
    color: var(--muted);
}

.url-cell {
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
}

.opportunity-url {
    display: block;
    max-width: 760px;
    margin-top: 7px;
    color: var(--cyan);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.properties-form {
    display: grid;
    gap: 18px;
}

.editor-form {
    display: grid;
    gap: 18px;
    max-width: 980px;
}

.editor-form label {
    display: grid;
    gap: 8px;
}

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

.form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.property-card {
    min-height: 82px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(11, 18, 34, 0.78);
    cursor: pointer;
}

.property-card input {
    width: 18px;
    min-height: 18px;
}

.property-card span {
    display: grid;
    gap: 5px;
}

.property-card small,
.empty-state {
    color: var(--muted);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

td small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    line-height: 1.45;
}

.actions-cell {
    display: flex;
    gap: 12px;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

@media (max-width: 860px) {
    .app-shell,
    .login-panel {
        display: block;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
    }

    .main {
        padding: 24px;
    }

    .metric-grid,
    .inline-form {
        grid-template-columns: 1fr;
    }

    .login-panel {
        padding: 28px;
    }

    .login-copy h1,
    .hero h1,
    .page-header h1 {
        font-size: 34px;
    }
}
