:root {
    color-scheme: dark;
    --bg: #0c0812;
    --bg-raised: #120d1a;
    --surface: #181121;
    --surface-2: #20162c;
    --surface-3: #2a1d39;
    --border: rgba(255, 255, 255, 0.085);
    --border-strong: rgba(215, 178, 89, 0.24);
    --text: #f7f3fb;
    --text-soft: #c2b9ca;
    --muted: #8f849a;
    --purple: #8e5dd9;
    --purple-soft: #b794ec;
    --gold: #d8b35b;
    --gold-bright: #f2d486;
    --green: #4ed6a1;
    --red: #ff7d8e;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
    --sidebar-width: 272px;
    font-family: "DM Sans", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 75% -10%, rgba(111, 64, 170, 0.14), transparent 34rem),
        var(--bg);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

button,
input,
[tabindex] {
    outline: none;
}

button:focus-visible,
input:focus-visible {
    box-shadow: 0 0 0 3px rgba(142, 93, 217, 0.28);
}

svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hidden {
    display: none !important;
}

.eyebrow {
    display: block;
    color: var(--gold);
    font-size: 0.71rem;
    font-weight: 800;
    letter-spacing: 0.13em;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.brand-mark {
    width: 39px;
    height: 39px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(216, 179, 91, 0.15));
}

.brand > div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.brand strong {
    font-family: "Manrope", sans-serif;
    font-size: 0.91rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.brand strong span {
    color: var(--gold);
}

.brand small {
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.login-view {
    display: grid;
    grid-template-columns: minmax(430px, 0.86fr) minmax(520px, 1.14fr);
    min-height: 100vh;
}

.login-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: min(100%, 520px);
    padding: 56px clamp(36px, 6vw, 84px);
    margin: 0 auto;
}

.brand-login {
    position: absolute;
    top: 38px;
}

.login-copy {
    margin-bottom: 34px;
}

.login-copy h1 {
    max-width: 440px;
    margin: 13px 0 14px;
    font-family: "Manrope", sans-serif;
    font-size: clamp(2rem, 3.3vw, 3.15rem);
    line-height: 1.07;
    letter-spacing: -0.045em;
}

.login-copy p {
    max-width: 470px;
    margin: 0;
    color: var(--text-soft);
    line-height: 1.65;
}

.login-form,
.partner-form {
    display: grid;
    gap: 18px;
}

.login-form label,
.partner-form label {
    display: grid;
    gap: 8px;
}

.login-form label > span,
.partner-form label > span {
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 47px;
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 0 14px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.035);
    transition: border-color 160ms ease, background 160ms ease;
}

input::placeholder {
    color: #6f6577;
}

input:hover {
    border-color: rgba(255, 255, 255, 0.16);
}

input:focus {
    border-color: var(--purple);
    background: rgba(142, 93, 217, 0.06);
}

.button {
    min-height: 44px;
    border: 0;
    border-radius: 10px;
    padding: 0 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    cursor: pointer;
    font-weight: 700;
    transition: transform 150ms ease, background 150ms ease, opacity 150ms ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:disabled {
    cursor: wait;
    opacity: 0.62;
}

.button.primary {
    color: #190f20;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold));
    box-shadow: 0 12px 28px rgba(216, 179, 91, 0.16);
}

.button.primary svg {
    width: 18px;
}

.button.secondary {
    border: 1px solid var(--border);
    color: var(--text-soft);
    background: var(--surface);
}

.button.secondary:hover:not(:disabled) {
    color: var(--text);
    background: var(--surface-2);
}

.button.wide {
    width: 100%;
    margin-top: 4px;
}

.login-note {
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 0.77rem;
    line-height: 1.5;
}

.form-message {
    margin: -4px 0 0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.78rem;
    line-height: 1.4;
}

.form-message.error {
    color: #ffb6c0;
    background: rgba(255, 125, 142, 0.1);
}

.form-message.success {
    color: #9aefcf;
    background: rgba(78, 214, 161, 0.1);
}

.login-art {
    position: relative;
    overflow: hidden;
    margin: 14px 14px 14px 0;
    border: 1px solid var(--border-strong);
    border-radius: 24px;
    background:
        linear-gradient(145deg, rgba(43, 22, 60, 0.92), rgba(17, 11, 24, 0.96)),
        var(--surface);
    box-shadow: var(--shadow);
}

.art-grid {
    position: absolute;
    inset: 0;
    opacity: 0.22;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.075) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.075) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: linear-gradient(to bottom, black, transparent 90%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
}

.orb-one {
    top: 11%;
    right: 8%;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle at 35% 30%, rgba(238, 205, 125, 0.85), rgba(115, 61, 157, 0.34) 38%, transparent 70%);
    opacity: 0.6;
}

.orb-two {
    bottom: -120px;
    left: -60px;
    width: 420px;
    height: 420px;
    border: 1px solid rgba(216, 179, 91, 0.2);
    box-shadow: inset 0 0 80px rgba(142, 93, 217, 0.14);
}

.art-card {
    position: absolute;
    left: clamp(42px, 8vw, 110px);
    right: 42px;
    bottom: clamp(48px, 9vh, 110px);
    z-index: 1;
}

.art-card > span {
    color: var(--gold);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.15em;
}

.art-card > strong {
    display: block;
    margin-top: 16px;
    font-family: "Manrope", sans-serif;
    font-size: clamp(2.5rem, 5vw, 5.6rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.art-line {
    width: min(340px, 70%);
    height: 1px;
    margin: 34px 0 21px;
    background: linear-gradient(90deg, var(--gold), transparent);
}

.art-card p {
    color: var(--text-soft);
    font-size: 0.82rem;
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    padding: 26px 20px 18px;
    background: rgba(16, 11, 22, 0.96);
    backdrop-filter: blur(20px);
}

.sidebar .brand {
    padding: 0 8px 28px;
}

.main-nav {
    display: grid;
    gap: 5px;
}

.nav-item {
    width: 100%;
    min-height: 47px;
    border: 0;
    border-radius: 10px;
    padding: 0 13px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    text-align: left;
    transition: color 150ms ease, background 150ms ease;
}

.nav-item svg {
    width: 19px;
    height: 19px;
}

.nav-item:hover {
    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.035);
}

.nav-item.active {
    color: var(--gold-bright);
    background: linear-gradient(90deg, rgba(216, 179, 91, 0.12), rgba(142, 93, 217, 0.06));
    box-shadow: inset 2px 0 var(--gold);
}

body:not([data-role="admin"]) .admin-only {
    display: none !important;
}

body[data-role="admin"] .affiliate-only {
    display: none !important;
}

.sidebar-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: auto 5px 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.025);
}

.sidebar-status > div {
    display: grid;
    gap: 2px;
}

.sidebar-status strong {
    font-size: 0.75rem;
}

.sidebar-status small {
    color: var(--muted);
    font-size: 0.67rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
    box-shadow: 0 0 0 4px rgba(143, 132, 154, 0.08);
}

.status-dot.online {
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(78, 214, 161, 0.09);
}

.status-dot.pending {
    background: var(--gold);
    box-shadow: 0 0 0 4px rgba(216, 179, 91, 0.09);
}

.status-dot.offline {
    background: var(--red);
    box-shadow: 0 0 0 4px rgba(255, 125, 142, 0.09);
}

.account-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--border);
    padding: 17px 4px 0;
}

.account-card > div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.account-card strong {
    overflow: hidden;
    font-size: 0.76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-card small {
    color: var(--muted);
    font-size: 0.67rem;
}

.avatar,
.mini-avatar {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(216, 179, 91, 0.18);
    border-radius: 50%;
    color: var(--gold-bright);
    background: linear-gradient(145deg, rgba(142, 93, 217, 0.25), rgba(216, 179, 91, 0.08));
    font-weight: 800;
}

.avatar {
    width: 36px;
    height: 36px;
    font-size: 0.68rem;
}

.mini-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.66rem;
}

.icon-button {
    width: 38px;
    height: 38px;
    border: 1px solid transparent;
    border-radius: 9px;
    display: inline-grid;
    place-items: center;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}

.icon-button:hover {
    border-color: var(--border);
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.icon-button svg {
    width: 18px;
    height: 18px;
}

.workspace {
    grid-column: 2;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 86px;
    border-bottom: 1px solid var(--border);
    padding: 0 clamp(22px, 4vw, 54px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: rgba(12, 8, 18, 0.82);
    backdrop-filter: blur(18px);
}

.topbar-left,
.topbar-actions {
    display: flex;
    align-items: center;
}

.topbar-left {
    gap: 12px;
}

.topbar-left > div {
    display: grid;
    gap: 4px;
}

.topbar h1 {
    margin: 0;
    font-family: "Manrope", sans-serif;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
}

.topbar-actions {
    gap: 10px;
}

.menu-button {
    display: none;
}

.month-picker {
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
}

.month-picker span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
}

.month-picker input {
    width: auto;
    min-height: 0;
    border: 0;
    padding: 0;
    color-scheme: dark;
    background: transparent;
    font-size: 0.79rem;
    font-weight: 700;
}

.month-picker input:focus {
    box-shadow: none;
}

.content {
    width: min(100%, 1530px);
    margin: 0 auto;
    padding: clamp(24px, 3.4vw, 48px) clamp(20px, 4vw, 54px) 64px;
}

.page-view {
    display: none;
}

.page-view.active {
    display: block;
    animation: view-in 260ms ease both;
}

@keyframes view-in {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.period-hero {
    position: relative;
    overflow: hidden;
    min-height: 172px;
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    padding: clamp(25px, 3.5vw, 40px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    background:
        radial-gradient(circle at 84% 0, rgba(216, 179, 91, 0.15), transparent 17rem),
        linear-gradient(115deg, rgba(71, 40, 92, 0.64), rgba(24, 17, 33, 0.94) 64%);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
}

.period-hero::after {
    content: "";
    position: absolute;
    right: 16%;
    top: -110px;
    width: 300px;
    height: 300px;
    border: 1px solid rgba(216, 179, 91, 0.12);
    border-radius: 50%;
}

.period-hero h2 {
    margin: 10px 0 8px;
    font-family: "Manrope", sans-serif;
    font-size: clamp(1.8rem, 3vw, 2.75rem);
    letter-spacing: -0.045em;
    text-transform: capitalize;
}

.period-hero p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.82rem;
}

.commission-pill {
    position: relative;
    z-index: 1;
    min-width: 170px;
    border: 1px solid rgba(216, 179, 91, 0.25);
    border-radius: 14px;
    padding: 17px 21px;
    display: grid;
    gap: 4px;
    background: rgba(13, 8, 18, 0.48);
    backdrop-filter: blur(12px);
}

.commission-pill span {
    color: var(--muted);
    font-size: 0.69rem;
}

.commission-pill strong {
    color: var(--gold-bright);
    font-family: "Manrope", sans-serif;
    font-size: 1.65rem;
}

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

.metric-card {
    min-height: 190px;
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(145deg, rgba(30, 21, 41, 0.96), rgba(20, 14, 28, 0.96));
    transition: border-color 170ms ease, transform 170ms ease;
}

.metric-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
    transform: translateY(-2px);
}

.metric-card.featured {
    border-color: rgba(216, 179, 91, 0.24);
    background: linear-gradient(145deg, rgba(58, 39, 51, 0.98), rgba(27, 18, 33, 0.98));
}

.metric-icon {
    width: 38px;
    height: 38px;
    margin-bottom: 19px;
    border-radius: 10px;
    display: grid;
    place-items: center;
}

.metric-icon svg {
    width: 18px;
    height: 18px;
}

.metric-icon.purple {
    color: var(--purple-soft);
    background: rgba(142, 93, 217, 0.12);
}

.metric-icon.green {
    color: var(--green);
    background: rgba(78, 214, 161, 0.1);
}

.metric-icon.red {
    color: var(--red);
    background: rgba(255, 125, 142, 0.1);
}

.metric-icon.gold {
    color: var(--gold-bright);
    background: rgba(216, 179, 91, 0.12);
}

.metric-card > span {
    color: var(--text-soft);
    font-size: 0.73rem;
    font-weight: 600;
}

.metric-card > strong {
    margin: 7px 0 6px;
    font-family: "Manrope", sans-serif;
    font-size: clamp(1.35rem, 2vw, 1.85rem);
    letter-spacing: -0.045em;
}

.metric-card > small {
    margin-top: auto;
    color: var(--muted);
    font-size: 0.66rem;
    line-height: 1.45;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
    gap: 18px;
}

.panel-card,
.table-card {
    border: 1px solid var(--border);
    border-radius: 15px;
    background: linear-gradient(145deg, rgba(27, 19, 37, 0.96), rgba(20, 14, 28, 0.96));
}

.panel-card {
    padding: 23px;
}

.card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.card-heading h3,
.formula-card h3 {
    margin: 6px 0 0;
    font-family: "Manrope", sans-serif;
    font-size: 1.03rem;
    letter-spacing: -0.025em;
}

.text-button {
    border: 0;
    padding: 6px;
    color: var(--gold);
    background: transparent;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
}

.recent-list {
    display: grid;
}

.recent-item,
.partner-row {
    min-height: 61px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.recent-item:first-child,
.partner-row:first-child {
    border-top: 0;
}

.player-identity,
.partner-identity {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.player-identity > div,
.partner-identity > div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.player-identity strong,
.partner-identity strong {
    overflow: hidden;
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-identity small,
.partner-identity small {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.67rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-meta {
    display: grid;
    gap: 3px;
    text-align: right;
}

.recent-meta strong {
    color: var(--green);
    font-size: 0.77rem;
}

.recent-meta small {
    color: var(--muted);
    font-size: 0.64rem;
}

.inline-empty {
    min-height: 150px;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
}

.formula-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 22px;
}

.formula-card p {
    margin: 10px 0 0;
    color: var(--text-soft);
    font-size: 0.79rem;
    line-height: 1.6;
}

.formula {
    overflow-x: auto;
    min-height: 67px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.12);
    white-space: nowrap;
}

.formula span,
.formula strong {
    border-radius: 7px;
    padding: 7px 9px;
    font-size: 0.73rem;
    background: rgba(255, 255, 255, 0.045);
}

.formula strong {
    color: var(--gold-bright);
    background: rgba(216, 179, 91, 0.1);
}

.formula b {
    color: var(--muted);
    font-weight: 500;
}

.formula-card > small {
    color: var(--muted);
    font-size: 0.65rem;
    line-height: 1.5;
}

.section-heading {
    margin-bottom: 24px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
}

.section-heading h2 {
    margin: 9px 0 7px;
    font-family: "Manrope", sans-serif;
    font-size: clamp(1.65rem, 2.7vw, 2.3rem);
    letter-spacing: -0.045em;
}

.section-heading p {
    max-width: 690px;
    margin: 0;
    color: var(--text-soft);
    font-size: 0.79rem;
    line-height: 1.55;
}

.search-box {
    width: min(100%, 280px);
    position: relative;
}

.search-box svg {
    position: absolute;
    left: 13px;
    top: 50%;
    width: 17px;
    height: 17px;
    color: var(--muted);
    transform: translateY(-50%);
}

.search-box input {
    padding-left: 40px;
}

.table-card {
    overflow: hidden;
}

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

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

th,
td {
    height: 67px;
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    text-align: left;
}

th {
    height: 50px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.018);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

td {
    color: var(--text-soft);
    font-size: 0.76rem;
}

tbody tr {
    transition: background 140ms ease;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.018);
}

.numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

td.numeric {
    font-weight: 700;
}

.positive {
    color: var(--green);
}

.negative {
    color: var(--red);
}

.partner-tag {
    border: 1px solid rgba(142, 93, 217, 0.16);
    border-radius: 6px;
    padding: 5px 7px;
    color: var(--purple-soft);
    background: rgba(142, 93, 217, 0.07);
    font-size: 0.68rem;
}

.table-footer {
    min-height: 54px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: var(--muted);
    font-size: 0.68rem;
}

.empty-state {
    min-height: 320px;
    padding: 40px 20px;
    display: grid;
    place-content: center;
    justify-items: center;
    text-align: center;
}

.empty-icon {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    color: var(--purple-soft);
    background: rgba(142, 93, 217, 0.1);
}

.empty-icon svg {
    width: 24px;
    height: 24px;
}

.empty-state h3 {
    margin: 17px 0 7px;
    font-family: "Manrope", sans-serif;
    font-size: 1rem;
}

.empty-state p {
    max-width: 400px;
    margin: 0;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.5;
}

.link-layout {
    display: grid;
    grid-template-columns: minmax(230px, 0.34fr) minmax(0, 1fr);
    gap: 18px;
}

.link-card {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.code-display {
    margin: 17px 0 13px;
    color: var(--gold-bright);
    font-family: "Manrope", sans-serif;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: 0.06em;
}

.link-card p {
    max-width: 260px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.55;
}

.link-details {
    display: grid;
    gap: 0;
}

.link-row {
    border-bottom: 1px solid var(--border);
    padding: 3px 0 20px;
    display: grid;
    grid-template-columns: minmax(180px, 0.42fr) minmax(250px, 1fr);
    align-items: center;
    gap: 25px;
}

.link-row + .link-row {
    padding-top: 20px;
}

.link-row > div:first-child {
    display: grid;
    gap: 4px;
}

.link-row > div:first-child span {
    font-size: 0.78rem;
    font-weight: 700;
}

.link-row > div:first-child small {
    color: var(--muted);
    font-size: 0.67rem;
    line-height: 1.45;
}

.copy-field {
    position: relative;
}

.copy-field input {
    padding-right: 48px;
    color: var(--text-soft);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.7rem;
}

.copy-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
}

.info-note {
    margin-top: 20px;
    border: 1px solid rgba(142, 93, 217, 0.13);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--purple-soft);
    background: rgba(142, 93, 217, 0.055);
}

.info-note svg {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
}

.info-note p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.68rem;
    line-height: 1.55;
}

.info-note strong {
    color: var(--purple-soft);
}

.partner-layout {
    display: grid;
    grid-template-columns: minmax(360px, 0.75fr) minmax(390px, 1.25fr);
    gap: 18px;
    align-items: start;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 0.7fr;
    gap: 12px;
}

.suffix-input {
    position: relative;
}

.suffix-input input {
    padding-right: 36px;
}

.suffix-input > span {
    position: absolute;
    right: 14px;
    top: 50%;
    color: var(--gold);
    transform: translateY(-50%);
    font-weight: 800;
}

.partner-list-card {
    min-height: 300px;
}

.count-badge {
    min-width: 28px;
    height: 28px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    color: var(--gold-bright);
    background: rgba(216, 179, 91, 0.08);
    font-size: 0.7rem;
    font-weight: 800;
}

.partner-details {
    display: flex;
    align-items: center;
    gap: 10px;
}

.partner-link-button {
    border: 0;
    padding: 5px 7px;
    color: var(--text-soft);
    background: transparent;
    cursor: pointer;
    font-size: 0.67rem;
    font-weight: 700;
}

.partner-link-button:hover {
    color: var(--gold-bright);
}

.partner-details code {
    border-radius: 6px;
    padding: 5px 7px;
    color: var(--purple-soft);
    background: rgba(142, 93, 217, 0.08);
    font-size: 0.67rem;
}

.partner-details span {
    min-width: 43px;
    color: var(--gold-bright);
    font-size: 0.75rem;
    font-weight: 800;
    text-align: right;
}

.toast-region {
    position: fixed;
    right: 20px;
    top: 20px;
    z-index: 100;
    display: grid;
    gap: 9px;
    pointer-events: none;
}

.toast {
    width: min(350px, calc(100vw - 40px));
    border: 1px solid rgba(78, 214, 161, 0.2);
    border-radius: 10px;
    padding: 13px 15px;
    color: #baf3dc;
    background: rgba(20, 37, 34, 0.96);
    box-shadow: var(--shadow);
    font-size: 0.76rem;
    animation: toast-in 180ms ease both;
    transition: opacity 180ms ease, transform 180ms ease;
}

.toast.error {
    border-color: rgba(255, 125, 142, 0.22);
    color: #ffc2ca;
    background: rgba(43, 24, 31, 0.97);
}

.toast.leaving {
    opacity: 0;
    transform: translateY(-6px);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-7px);
    }
}

@media (max-width: 1180px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .partner-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    .login-view {
        grid-template-columns: 1fr;
    }

    .login-panel {
        min-height: 100vh;
    }

    .login-art {
        display: none;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow);
        transition: transform 200ms ease;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .workspace {
        grid-column: 1;
    }

    .menu-button {
        display: inline-grid;
    }

    .link-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .topbar {
        min-height: 76px;
        padding: 0 16px;
    }

    .topbar .eyebrow {
        display: none;
    }

    .topbar h1 {
        font-size: 1rem;
    }

    .month-picker span,
    .button.secondary span {
        display: none;
    }

    .month-picker {
        padding: 0 9px;
    }

    .content {
        padding: 20px 14px 45px;
    }

    .period-hero {
        min-height: 0;
        padding: 25px 20px;
        align-items: flex-start;
        flex-direction: column;
    }

    .commission-pill {
        min-width: 150px;
    }

    .metric-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .metric-card {
        min-height: 172px;
        padding: 16px;
    }

    .metric-card > strong {
        font-size: 1.18rem;
    }

    .section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }

    .link-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

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

    .table-footer {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
    }
}

@media (max-width: 440px) {
    .login-panel {
        padding: 80px 22px 40px;
    }

    .brand-login {
        top: 24px;
    }

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

    .metric-card {
        min-height: 160px;
    }

    .panel-card {
        padding: 18px;
    }

    .partner-details code {
        max-width: 92px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
