:root {
    --bg: #090d14;
    --bg-2: #101722;
    --bg-3: #171f2d;
    --panel: #101826;
    --panel-soft: #162132;
    --panel-2: #1c2739;
    --line: #26344a;
    --line-soft: #31425d;
    --text: #eef3ff;
    --muted: #95a6c5;
    --accent: #d8a94b;
    --accent-2: #5ca7ff;
    --success: #4bb36e;
    --danger: #cf5d5d;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at top, rgba(72, 102, 154, 0.14), transparent 30%),
        linear-gradient(180deg, rgba(11, 15, 24, 0.95), rgba(9, 13, 20, 0.98)),
        url('/img/bg.jpg') center top / cover fixed no-repeat;
    color: var(--text);
    font: 13px/1.42 Inter, "Segoe UI", system-ui, sans-serif;
}

a {
    color: #8cc3ff;
    text-decoration: none;
}

a:hover {
    color: #b4d7ff;
}

code {
    color: #f7d68f;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background:
        linear-gradient(180deg, rgba(58, 47, 38, 0.96), rgba(22, 24, 31, 0.98)),
        url('/img/toolbar.png') center / auto repeat-x;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.38);
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 78px;
    padding: 0 22px;
}

.topbar__brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar__logo {
    height: 44px;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.topbar__brand-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.topbar__brand-title {
    color: #f0e2be;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.topbar__site-link {
    color: #c7d1e4;
    font-size: 12px;
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.topbar__logout-form {
    margin: 0;
}

.topbar__logout {
    min-height: 32px;
    padding: 0 14px;
}

.topbar__badge,
.topbar__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
    color: #f7f8fb;
    font-size: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.topbar__badge img {
    height: 18px;
}

.topbar__chip--currency img {
    width: 14px;
    height: 14px;
}

.topbar__chip--identity {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar__login {
    margin-left: 4px;
    color: #79dc89;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(121, 220, 137, 0.18);
}

.shell {
    display: grid;
    grid-template-columns: 308px minmax(0, 1fr);
    gap: 22px;
    min-height: calc(100vh - 78px);
    padding: 18px;
}

.sidebar {
    padding: 0;
}

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

.shell--guest .content {
    max-width: 860px;
    margin: 0 auto;
}

.brand--sidebar {
    margin-bottom: 18px;
    padding: 18px 18px 16px;
    border: 1px solid rgba(216, 169, 75, 0.16);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
        rgba(13, 20, 31, 0.82);
    box-shadow: var(--shadow);
}

.brand__eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(216, 169, 75, 0.12);
    color: #f3d89c;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.05;
}

.brand p {
    margin: 10px 0 0;
    color: var(--muted);
}

.meta-card {
    margin: 18px 0;
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    background: rgba(14, 20, 31, 0.88);
    box-shadow: var(--shadow);
}

.meta-card__label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.meta-card__value {
    color: #fff;
    font-size: 22px;
    font-weight: 800;
}

.nav-section {
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(14, 20, 31, 0.9);
    box-shadow: var(--shadow);
}

.nav-section__title {
    margin: 0;
    padding: 11px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    color: #a7b5cc;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.nav-list {
    margin: 0;
    padding: 8px;
    list-style: none;
}

.nav-list li + li {
    margin-top: 4px;
}

.nav-list a {
    display: block;
    padding: 11px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #dbe6fa;
    transition: 0.2s ease;
}

.nav-list a:hover {
    border-color: rgba(92, 167, 255, 0.22);
    background: rgba(92, 167, 255, 0.09);
}

.nav-list a.is-active {
    border-color: rgba(216, 169, 75, 0.32);
    background: rgba(216, 169, 75, 0.12);
    color: #fff1bf;
    font-weight: 700;
}

.sidebar .logout-form {
    margin-top: 18px;
}

.content {
    min-width: 0;
}

.page {
    max-width: 100%;
}

.inventory-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.inventory-toolbar__field {
    width: 100%;
    max-width: 420px;
}

.inventory-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header {
    margin-bottom: 18px;
    padding: 22px 24px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
        rgba(15, 23, 36, 0.9);
    box-shadow: var(--shadow);
}

.page-header h1 {
    margin: 0;
    color: #fff;
    font-size: 18px;
    line-height: 1.15;
}

.page-header p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.is-guest .page {
    max-width: 860px;
    margin: 0 auto;
}

.card,
fieldset {
    margin: 0 0 18px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
        rgba(15, 23, 36, 0.92);
    box-shadow: var(--shadow);
}

.card > h2:first-child,
fieldset > legend {
    color: #fff;
}

.card__intro {
    color: var(--muted);
}

.notice,
.alert {
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid transparent;
}

.notice {
    background: rgba(255, 255, 255, 0.04);
}

.notice--error,
.alert--error {
    border-color: rgba(207, 93, 93, 0.28);
    background: rgba(207, 93, 93, 0.14);
}

.alert--success {
    border-color: rgba(75, 179, 110, 0.24);
    background: rgba(75, 179, 110, 0.14);
}

.alert--warning {
    border-color: rgba(216, 169, 75, 0.28);
    background: rgba(216, 169, 75, 0.12);
    color: #ffe7a7;
}

h1,
h2,
h3 {
    margin-top: 0;
}

h2 {
    font-size: 18px;
}

p {
    margin: 0 0 12px;
}

.stats {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 18px;
}

.stat {
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    background: rgba(20, 30, 46, 0.9);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.stat:hover {
    border-color: rgba(92, 167, 255, 0.14);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.stat__label {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat__value {
    color: #fff;
    font-size: 24px;
    font-weight: 800;
}

.stat__value--currency {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.stat__value--login {
    color: #7ee08d;
    text-shadow: 0 0 12px rgba(126, 224, 141, 0.18);
}

.stat__value--currency img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.activity-feed__login {
    color: #7ee08d;
    font-weight: 700;
}

.activity-feed__date {
    color: #d9e6ff;
}

.activity-feed__ip {
    color: #8fc4ff;
    font-family: Consolas, "Courier New", monospace;
}

.activity-feed__costs {
    color: #ffb3b3;
    font-weight: 700;
}

.activity-feed__rest {
    color: #ffe2a2;
    font-weight: 700;
}

.activity-feed__source {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.activity-feed__source--lk {
    background: rgba(216, 169, 75, 0.16);
    color: #ffd88a;
}

.activity-feed__source--login {
    background: rgba(92, 167, 255, 0.14);
    color: #a9d0ff;
}

.activity-feed__source--password {
    background: rgba(197, 120, 255, 0.14);
    color: #dfb0ff;
}

.activity-feed__desc {
    color: #f2f6ff;
    line-height: 1.5;
}

.inventory-record__item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.inventory-record__item strong {
    color: #f4f7ff;
}

.inventory-record__item span {
    color: #8fa6d2;
    font-size: 11px;
}

.inventory-record__status {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.inventory-record__status--pending {
    background: rgba(216, 169, 75, 0.14);
    color: #ffd88a;
}

.inventory-record__status--sent {
    background: rgba(75, 179, 110, 0.14);
    color: #98f0b3;
}

.referral-stat__value {
    font-size: 22px;
}

.referral-stat__value--accent {
    color: #77d3ff;
    text-shadow: 0 0 14px rgba(119, 211, 255, 0.16);
}

.referral-stat__meta {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.referral-link-box input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid rgba(92, 167, 255, 0.22);
    border-radius: 12px;
    background: rgba(10, 16, 26, 0.96);
    color: #d8e6ff;
    font: 13px/1.4 Consolas, "Courier New", monospace;
}

.referral-link-box__input {
    color: #77d3ff !important;
    font-weight: 700;
    text-shadow: 0 0 12px rgba(119, 211, 255, 0.12);
}

.referral-table td,
.referral-table th {
    white-space: nowrap;
}

.character-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}

/* --- Character card: class-specific accent colors --- */
.character-card { --card-accent: #d8a94b; }
.character-card[data-class="warrior"]   { --card-accent: #ff6b4a; }
.character-card[data-class="ranger"]    { --card-accent: #5fe690; }
.character-card[data-class="warden"]    { --card-accent: #5ca7ff; }
.character-card[data-class="assassin"]  { --card-accent: #c278ff; }
.character-card[data-class="mage"]      { --card-accent: #4de8e8; }
.character-card[data-class="priest"]    { --card-accent: #ffd88a; }
.character-card[data-class="bard"]      { --card-accent: #ff8ec4; }
.character-card[data-class="marksman"]  { --card-accent: #ffa74d; }
.character-card[data-class="protector"] { --card-accent: #7eb8ff; }

.character-card {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-top: 3px solid var(--card-accent);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 60%),
        rgba(11, 18, 28, 0.92);
    overflow: hidden;
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.character-card:hover {
    border-color: var(--card-accent);
    border-top-color: var(--card-accent);
    transform: translateY(-3px);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.35),
        0 0 20px color-mix(in srgb, var(--card-accent) 15%, transparent);
}

.character-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 14px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--card-accent) 8%, transparent) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.character-card__name {
    color: #f5f8ff;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.character-card__roleid {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.character-card__level {
    padding: 6px 12px;
    border: 1px solid color-mix(in srgb, var(--card-accent) 30%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--card-accent) 12%, transparent);
    color: var(--card-accent);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    filter: brightness(1.2);
}

.character-card__table {
    width: 100%;
    border-radius: 0;
    background: transparent;
}

.character-card__table th,
.character-card__table td {
    padding: 9px 18px;
    border-right: 0;
}

.character-card__table tr:nth-child(odd) th,
.character-card__table tr:nth-child(odd) td {
    background: rgba(255, 255, 255, 0.02);
}

.character-card__table th {
    width: 38%;
    color: #8a9bba;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.02);
}

.character-card__table td {
    color: #f5f8ff;
    font-weight: 700;
}

.character-card__value {
    display: inline-block;
}

.character-card__value--name {
    color: var(--card-accent);
    font-size: 15px;
    font-weight: 800;
    text-shadow: 0 0 14px color-mix(in srgb, var(--card-accent) 25%, transparent);
}

.character-card__value--level {
    color: #ffd88a;
}

.character-card__value--class {
    color: var(--card-accent);
    filter: brightness(1.15);
}

.character-card__value--guild {
    color: #f3b6ff;
}

.character-card__value--gender {
    color: #d9e6ff;
}

form {
    margin: 0;
}

.form-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.field--checkbox {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.field label {
    color: #d7e0f0;
    font-size: 13px;
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: #0a1019;
    color: #f2f6ff;
    font-size: 13px;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(92, 167, 255, 0.8);
    box-shadow: 0 0 0 3px rgba(92, 167, 255, 0.18);
}

textarea {
    min-height: 420px;
    resize: vertical;
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-2);
}

button,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 16px;
    border: 1px solid rgba(216, 169, 75, 0.44);
    border-radius: 10px;
    background: linear-gradient(180deg, #e0b253, #b98525);
    color: #18140e;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
    transition: filter 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

button:hover,
.button-link:hover {
    filter: brightness(1.05);
    color: #100d07;
}

.button-link--secondary,
.button--secondary {
    border-color: rgba(84, 119, 188, 0.5);
    background: linear-gradient(180deg, #32496f, #21324c);
    color: #f3f7ff;
}

.button-link--secondary:hover,
.button--secondary:hover {
    color: #fff;
}

.button-link--danger,
.button--danger,
.modal-close {
    border-color: rgba(203, 91, 91, 0.5);
    background: linear-gradient(180deg, #d46969, #ab4444);
    color: #fff;
}

.button-link--ghost {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #dfe9ff;
}

.button-link--accent {
    border-color: rgba(216, 169, 75, 0.44);
    background: rgba(216, 169, 75, 0.1);
    color: #ffd889;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 14px;
    background: rgba(12, 18, 29, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

th,
td {
    padding: 11px 14px;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
    vertical-align: top;
    transition: background 0.15s ease;
}

th:last-child,
td:last-child {
    border-right: 0;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    color: #d8a94b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    background: linear-gradient(180deg, rgba(216, 169, 75, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border-bottom: 2px solid rgba(216, 169, 75, 0.15);
    padding: 13px 14px;
    white-space: nowrap;
}

tbody tr:nth-child(odd) td {
    background: rgba(255, 255, 255, 0.015);
}

tbody tr:nth-child(even) td {
    background: transparent;
}

tbody tr {
    transition: background 0.15s ease;
}

tbody tr:hover td {
    background: rgba(92, 167, 255, 0.07);
}

tbody tr:hover td:first-child {
    box-shadow: inset 3px 0 0 var(--accent);
}

tbody td {
    font-size: 13px;
    line-height: 1.45;
}

.table-detail-cell {
    padding: 0;
    background: rgba(8, 11, 18, 0.94);
}

/* --- Table wrapper for horizontal scroll on narrow screens --- */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
}

.table-scroll table {
    min-width: 700px;
}

/* --- Table cell typography helpers --- */
tbody td .cell-id {
    color: var(--muted);
    font-size: 12px;
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}

tbody td .cell-date {
    color: #8a9bba;
    font-size: 12px;
    white-space: nowrap;
}

tbody td .cell-ip {
    color: #7eb8ff;
    font-size: 12px;
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    letter-spacing: 0.02em;
}

tbody td .cell-login {
    color: #8fe6a5;
    font-weight: 700;
}

tbody td .cell-email {
    color: #c4d5f0;
    font-size: 12px;
    word-break: break-all;
}

/* --- Row status indicators --- */
tbody tr.row--success td:first-child {
    box-shadow: inset 3px 0 0 #5fe690;
}

tbody tr.row--warning td:first-child {
    box-shadow: inset 3px 0 0 #d8a94b;
}

tbody tr.row--danger td:first-child {
    box-shadow: inset 3px 0 0 #ff6b4a;
}

tbody tr.row--muted td {
    opacity: 0.55;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.empty {
    padding: 14px 16px;
    border: 1px dashed rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    color: var(--muted);
}

.legacy-editor #EditTab {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.legacy-editor #EditTab a {
    display: inline-block;
    padding: 10px 14px;
    border: 1px solid rgba(92, 167, 255, 0.2);
    border-radius: 12px;
    background: rgba(92, 167, 255, 0.08);
    color: #e7f0ff;
}

.legacy-editor #EditTab a.is-active {
    border-color: rgba(216, 169, 75, 0.34);
    background: rgba(216, 169, 75, 0.14);
    color: #ffecb8;
}

.legacy-editor #EditTabContent > div,
.legacy-editor #EditTabContent .tab-pane {
    display: none;
}

.legacy-editor #EditTabContent > div:first-child,
.legacy-editor #EditTabContent .tab-pane:first-child {
    display: block;
}

.legacy-editor textarea {
    min-height: 520px;
}

.legacy-editor center {
    margin-top: 18px;
}

.legacy-editor #save_but {
    min-width: 160px;
}

.legacy-editor-result {
    margin-bottom: 14px;
}

.settings-tabs-card {
    padding-top: 10px;
}

.settings-group + .settings-group {
    margin-top: 22px;
}

.referral-rewards-table th {
    white-space: nowrap;
}

.referral-rewards-table td {
    padding: 10px;
}

.referral-rewards-table input[type="text"],
.referral-rewards-table input[type="number"] {
    min-width: 96px;
    padding: 9px 10px;
    border-color: rgba(123, 150, 196, 0.28);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(9, 14, 23, 0.98), rgba(7, 11, 18, 0.98));
    color: #f5f8ff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 0 0 1px rgba(255, 255, 255, 0.015);
}

.referral-rewards-table input[type="text"]:focus,
.referral-rewards-table input[type="number"]:focus {
    border-color: rgba(216, 169, 75, 0.6);
    box-shadow:
        0 0 0 3px rgba(216, 169, 75, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.settings-referral-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.settings-referral-actions button {
    min-width: 220px;
}

.referral-rewards-table--legacy th {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.referral-item-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.referral-item-cell__icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex: 0 0 32px;
}

.referral-item-cell__placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-weight: 700;
    flex: 0 0 32px;
}

.referral-item-cell__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.referral-item-cell__meta strong {
    color: #f4f6fd;
    font-size: 13px;
    line-height: 1.2;
}

.referral-item-cell__meta span {
    color: #8fa6d2;
    font-size: 11px;
}

.referral-admin-summary {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 18px;
}

.referral-admin-summary__card {
    padding: 16px 18px;
    border: 1px solid rgba(92, 167, 255, 0.16);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
        rgba(14, 21, 33, 0.82);
}

.referral-admin-summary__eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    color: #95b8f2;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.referral-admin-summary__card h3 {
    margin: 0 0 6px;
    font-size: 17px;
}

.referral-admin-summary__card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.referral-legacy-table th,
.referral-legacy-table td {
    vertical-align: middle;
}

.referral-settings-group .settings-group__header {
    margin-bottom: 12px;
}

.referral-legacy-table thead th {
    white-space: nowrap;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}

.referral-legacy-table td > input[type="text"] {
    min-width: 88px;
}

.referral-legacy-table td:last-child > input[type="text"] {
    min-width: 260px;
}

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

.referral-admin-row {
    display: grid;
    gap: 14px;
    grid-template-columns: 120px 320px minmax(0, 1fr);
    align-items: start;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
        rgba(12, 18, 29, 0.84);
}

.referral-admin-row label {
    display: block;
    margin-bottom: 7px;
    color: #efe5c1;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.referral-admin-row__level input {
    text-align: center;
}

.referral-admin-row__main {
    display: grid;
    gap: 12px;
}

.referral-admin-fields {
    display: grid;
    gap: 12px;
}

.referral-admin-fields--compact {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.referral-admin-row .field {
    margin-bottom: 0;
}

.referral-admin-row .field--wide {
    grid-column: 1 / -1;
}

.referral-item-cell--large {
    min-height: 56px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.referral-item-cell__hint {
    margin-top: 8px;
    color: #ffcfda;
    font-size: 11px;
    line-height: 1.45;
}

.referral-item-cell--large .referral-item-cell__icon,
.referral-item-cell--large .referral-item-cell__placeholder {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
}

.referral-level-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.referral-level-field__label {
    color: #ffcfda;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.referral-donation-table td {
    vertical-align: middle;
}

.referral-donation-table .settings-table__name {
    font-size: 14px;
}

.referral-donation-table__meta code {
    color: #f7d68f;
}

.referral-donation-field {
    position: relative;
    display: flex;
    align-items: center;
}

.referral-donation-field input[type="text"] {
    padding-right: 40px;
}

.referral-donation-field__suffix {
    position: absolute;
    right: 14px;
    color: #f3d89c;
    font-size: 13px;
    font-weight: 700;
}

.system-tools {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.system-tool-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(113, 141, 197, 0.18);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(26, 34, 49, 0.95), rgba(20, 27, 39, 0.95));
}

.system-tool-card h3 {
    margin: 0 0 4px;
    color: #f3f6ff;
    font-size: 15px;
}

.system-tool-card p {
    margin: 0;
    color: #aab7d8;
    font-size: 12px;
    line-height: 1.45;
}

.system-tool-card__notes {
    margin: 10px 0 0;
    padding-left: 18px;
    color: #d6e1fa;
    font-size: 12px;
    line-height: 1.55;
}

.system-tool-card__notes li + li {
    margin-top: 4px;
}

.system-note__label {
    color: #cfdcff;
    font-weight: 700;
}

.system-note__command,
.system-note__inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border: 1px solid rgba(92, 167, 255, 0.24);
    border-radius: 8px;
    background: rgba(8, 14, 24, 0.84);
    color: #9fd0ff;
    font: 12px/1.45 Consolas, "Courier New", monospace;
    word-break: break-all;
}

.system-note__inline {
    padding: 1px 7px;
    color: #ffd88a;
    border-color: rgba(216, 169, 75, 0.22);
}

.system-note__token {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.system-note__token--info {
    border-color: rgba(92, 167, 255, 0.28);
    background: rgba(92, 167, 255, 0.12);
    color: #a9d0ff;
}

.system-note__token--success {
    border-color: rgba(75, 179, 110, 0.28);
    background: rgba(75, 179, 110, 0.14);
    color: #9cf2b7;
}

.system-note__token--warning {
    border-color: rgba(216, 169, 75, 0.28);
    background: rgba(216, 169, 75, 0.14);
    color: #ffe39d;
}

.system-note__token--danger {
    border-color: rgba(207, 93, 93, 0.3);
    background: rgba(207, 93, 93, 0.14);
    color: #ffb4b4;
}

.system-tool-card__action {
    flex-shrink: 0;
}

.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid rgba(113, 141, 197, 0.3);
    border-radius: 12px;
    background: linear-gradient(180deg, #31476f, #243757);
    color: #f4f7ff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.button-secondary:hover {
    background: linear-gradient(180deg, #3a5587, #2c4270);
}

.settings-group__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #efe5c1;
    font-size: 13px;
    font-weight: 700;
}

.settings-group__meta {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-tabs__tab {
    min-height: 34px;
    padding: 6px 14px;
    border: 1px solid rgba(92, 167, 255, 0.18);
    border-radius: 10px 10px 0 0;
    background: rgba(255, 255, 255, 0.02);
    color: #cfe0ff;
    font-size: 13px;
    font-weight: 400;
    box-shadow: none;
}

.settings-tabs__tab.is-active {
    border-color: rgba(216, 169, 75, 0.32);
    background: rgba(216, 169, 75, 0.12);
    color: #fff1bf;
}

.settings-tab-pane {
    display: none;
}

.settings-tab-pane.is-active {
    display: block;
}

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

.settings-table {
    border-radius: 12px;
}

.settings-table td {
    vertical-align: top;
}

.settings-table__name {
    display: block;
    color: #f5f7ff;
    font-size: 15px;
    font-weight: 700;
}

.settings-row--inactive {
    opacity: 0.74;
}

.settings-row--inactive td {
    background: rgba(255, 255, 255, 0.015);
}

.settings-row--inactive input,
.settings-row--inactive textarea,
.settings-row--inactive select,
.settings-row--inactive .legacy-switch__track,
.settings-row--inactive .settings-cost {
    filter: saturate(0.4) blur(0.15px);
}

.settings-row__badge {
    display: inline-flex;
    align-items: center;
    margin-top: 8px;
    padding: 4px 10px;
    border: 1px solid rgba(214, 153, 81, 0.26);
    border-radius: 999px;
    background: rgba(214, 153, 81, 0.14);
    color: #ffd89a;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.settings-table__desc {
    display: inline-block;
    color: #ffd5dd;
    line-height: 1.5;
    white-space: normal;
}

.settings-desc-block {
    padding: 12px 14px;
    border: 1px solid rgba(216, 169, 75, 0.18);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff1bf;
    font-weight: 700;
}

.settings-textarea {
    min-height: 140px;
}

.settings-cost {
    display: grid;
    gap: 10px;
}

.settings-cost__field {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 8px;
    align-items: center;
}

.settings-cost__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.settings-cost__icon img {
    width: 16px;
    height: 16px;
}

.legacy-switch {
    display: inline-flex;
    align-items: center;
}

.legacy-switch input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.legacy-switch__track {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 118px;
    height: 28px;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 7px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.15));
    cursor: pointer;
}

.legacy-switch__state {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50%;
    color: #d9e4f7;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.legacy-switch__state--on {
    color: #eef9ff;
}

.legacy-switch__state--off {
    color: #aab4c9;
}

.legacy-switch__knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(50% - 2px);
    height: 22px;
    border-radius: 5px;
    background: linear-gradient(180deg, #7fb2f5, #3d7ed4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
    transition: transform 0.18s ease;
}

.legacy-switch input[type="checkbox"]:not(:checked) + .legacy-switch__track .legacy-switch__knob {
    transform: translateX(57px);
    background: linear-gradient(180deg, #f1f1f1, #bababa);
}

.settings-table__meta {
    margin-top: 8px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.settings-table__inactive-note {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px dashed rgba(214, 153, 81, 0.3);
    border-radius: 10px;
    background: rgba(214, 153, 81, 0.08);
    color: #ffd89a;
    font-size: 12px;
    line-height: 1.5;
}

.legacy-switch--disabled {
    cursor: not-allowed;
}

.legacy-switch--disabled .legacy-switch__track {
    cursor: not-allowed;
}

.inspector-panel {
    overflow-x: auto;
    padding: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 30%),
        rgba(8, 12, 19, 0.9);
}

.detail-summary {
    display: grid;
    gap: 10px 18px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin: 0 0 18px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

.detail-summary--stacked {
    grid-template-columns: 1fr;
}

.detail-summary__row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-summary__label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.detail-summary__value {
    color: #fff;
    font-size: 14px;
    word-break: break-word;
}

.detail-summary__code {
    margin: 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: #17101b;
    border: 1px solid rgba(216, 169, 75, 0.18);
    color: #ffd98e;
    white-space: pre-wrap;
    word-break: break-word;
}

#bonus-data-content {
    background:
        linear-gradient(180deg, rgba(216, 169, 75, 0.13), rgba(216, 169, 75, 0.04)),
        #17101b;
    border-color: rgba(216, 169, 75, 0.4);
    color: #fff0bd;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.inspector-panel .userinfo_table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
    border-radius: 14px;
    overflow: hidden;
    background: #101720;
}

.inspector-panel .userinfo_table td {
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    vertical-align: top;
}

.inspector-panel .inspector-action {
    min-height: 26px;
    margin-left: 8px;
    margin-top: 0;
    padding: 4px 9px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.1;
    white-space: nowrap;
    vertical-align: middle;
}

.inspector-panel .userinfo_table td > b,
.inspector-panel .userinfo_table td > font,
.inspector-panel .userinfo_table td > a,
.inspector-panel .userinfo_table td > button {
    vertical-align: middle;
}

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

.search-card {
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
}

.search-card__title {
    margin: 0 0 12px;
    color: #efe5c1;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.search-card__row {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr auto;
    align-items: end;
}

.search-card__row--compact {
    grid-template-columns: 1fr 220px auto;
}

.search-card__result {
    margin-top: 12px;
    color: #f3d89c;
    font-size: 13px;
    font-weight: 700;
}

.toolbar-search {
    display: grid;
    grid-template-columns: repeat(8, minmax(120px, 1fr)) auto;
    gap: 12px;
    align-items: end;
}

.toolbar-search--stacked {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.toolbar-search__row {
    display: grid;
    gap: 12px;
    align-items: end;
}

.toolbar-search__row--character {
    grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 0.7fr) auto minmax(220px, auto);
}

.toolbar-search__row--accounts {
    grid-template-columns: repeat(6, minmax(140px, 1fr)) auto;
}

.toolbar-search__submit {
    min-width: 140px;
}

.toolbar-search__result {
    color: #f3d89c;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    padding-bottom: 10px;
}

.inventory-table__check {
    width: 42px;
    text-align: center;
}

.inventory-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.inventory-item img,
.inventory-item__placeholder {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    flex: 0 0 40px;
}

.inventory-item img {
    object-fit: cover;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.inventory-item__placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
    font-weight: 700;
}

.inventory-item__name {
    color: #fff;
    font-weight: 700;
}

.inventory-item__meta {
    color: var(--muted);
    font-size: 12px;
}

.inventory-grant-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
    gap: 20px;
    margin-bottom: 20px;
}

.inventory-grant-layout--split {
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.85fr);
    align-items: start;
}

.inventory-grant-main {
    position: sticky;
    top: 96px;
    border-color: rgba(216, 169, 75, 0.18);
    background:
        radial-gradient(circle at top right, rgba(216, 169, 75, 0.09), transparent 22%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
        rgba(15, 23, 36, 0.94);
}

.inventory-grant-main__header {
    margin-bottom: 18px;
}

.inventory-grant-main__header p {
    max-width: 760px;
}

.inventory-grant-tools {
    display: grid;
    gap: 16px;
}

.inventory-lookup-card__header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.inventory-lookup-card__header .card__title {
    margin-bottom: 4px;
    font-size: 16px;
}

.inventory-lookup-card {
    padding: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.012)),
        rgba(14, 21, 33, 0.9);
}

.inventory-selection-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 18px;
}

.inventory-grant-filters,
.inventory-grant-form {
    display: grid;
    gap: 16px;
}

.inventory-grant-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.inventory-grant-form .field {
    margin-bottom: 2px;
}

.inventory-grant-form input:not([type]),
.inventory-grant-form input[type="text"],
.inventory-grant-form input[type="number"],
.inventory-grant-form textarea,
.inventory-grant-form select,
.inventory-search-card input:not([type]),
.inventory-search-card input[type="text"],
.inventory-search-card input[type="number"],
.inventory-search-card select,
.inventory-grant-main input:not([type]),
.inventory-grant-main input[type="text"],
.inventory-grant-main input[type="number"],
.inventory-grant-main textarea,
.inventory-grant-main select,
.inventory-lookup-card input:not([type]),
.inventory-lookup-card input[type="text"],
.inventory-lookup-card input[type="number"],
.inventory-lookup-card textarea,
.inventory-lookup-card select {
    border-color: rgba(123, 150, 196, 0.28);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(9, 14, 23, 0.98), rgba(7, 11, 18, 0.98));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 0 0 1px rgba(255, 255, 255, 0.015);
    color: #f5f8ff;
    font-size: 14px;
}

.inventory-grant-form input:not([type]):focus,
.inventory-grant-form input[type="text"]:focus,
.inventory-grant-form input[type="number"]:focus,
.inventory-grant-form textarea:focus,
.inventory-grant-form select:focus,
.inventory-search-card input:not([type]):focus,
.inventory-search-card input[type="text"]:focus,
.inventory-search-card input[type="number"]:focus,
.inventory-search-card select:focus,
.inventory-grant-main input:not([type]):focus,
.inventory-grant-main input[type="text"]:focus,
.inventory-grant-main input[type="number"]:focus,
.inventory-grant-main textarea:focus,
.inventory-grant-main select:focus,
.inventory-lookup-card input:not([type]):focus,
.inventory-lookup-card input[type="text"]:focus,
.inventory-lookup-card input[type="number"]:focus,
.inventory-lookup-card textarea:focus,
.inventory-lookup-card select:focus {
    border-color: rgba(216, 169, 75, 0.6);
    box-shadow:
        0 0 0 3px rgba(216, 169, 75, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.inventory-grant-form label,
.inventory-search-card label {
    color: #eef2fb;
    font-size: 12px;
    letter-spacing: 0.03em;
}

.inventory-grant-main input:-webkit-autofill,
.inventory-grant-main input:-webkit-autofill:hover,
.inventory-grant-main input:-webkit-autofill:focus,
.inventory-lookup-card input:-webkit-autofill,
.inventory-lookup-card input:-webkit-autofill:hover,
.inventory-lookup-card input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f5f8ff;
    box-shadow:
        0 0 0 1000px #0b111c inset,
        0 0 0 3px rgba(216, 169, 75, 0.12);
    transition: background-color 9999s ease-out 0s;
}

.inventory-grant-form .field:nth-child(6) {
    grid-row: span 2;
}

.inventory-grant-form textarea {
    min-height: 206px;
    background:
        linear-gradient(180deg, rgba(11, 17, 27, 0.95), rgba(8, 12, 19, 0.98));
}

.inventory-grant-main .field,
.inventory-lookup-card .field {
    margin-bottom: 0;
}

.inventory-grant-main .field label,
.inventory-lookup-card .field label {
    margin-bottom: 2px;
    color: #eef2fb;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.inventory-grant-form button[type="submit"] {
    min-height: 46px;
    padding: 10px 18px;
    font-size: 14px;
    justify-self: end;
    min-width: 174px;
}

.inventory-row--active td {
    background: rgba(216, 169, 75, 0.12);
    box-shadow: inset 0 0 0 1px rgba(216, 169, 75, 0.16);
}

.inventory-search-card {
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
        rgba(255, 255, 255, 0.02);
}

.inventory-search-card__row {
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: end;
}

.inventory-search-card__actions {
    display: flex;
    align-items: end;
}

.inventory-search-card__actions button {
    min-width: 116px;
    min-height: 42px;
}

.inventory-results {
    display: grid;
    gap: 12px;
}

.inventory-results-wrap {
    overflow: hidden;
    transition: max-height 0.24s ease, opacity 0.2s ease, margin-top 0.2s ease;
    max-height: 1200px;
    opacity: 1;
}

.inventory-results-wrap.is-collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.inventory-results__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #efe5c1;
    font-size: 12px;
}

.inventory-selection-summary {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0;
    min-height: 72px;
    padding: 12px 14px;
    border: 1px solid rgba(92, 167, 255, 0.2);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(92, 167, 255, 0.08), rgba(92, 167, 255, 0.03)),
        rgba(15, 27, 43, 0.7);
}

.inventory-grant-main .inventory-selection-summary {
    min-height: 86px;
    border-color: rgba(216, 169, 75, 0.22);
    background:
        linear-gradient(180deg, rgba(216, 169, 75, 0.1), rgba(216, 169, 75, 0.03)),
        rgba(18, 26, 40, 0.76);
}

.inventory-selection-summary__label {
    color: #8fbaf5;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.inventory-selection-summary__value {
    color: #f1f6ff;
    font-weight: 700;
    font-size: 14px;
}

.inventory-table--selectable tbody tr {
    cursor: pointer;
}

.card__title {
    margin: 0 0 16px;
    font-size: 21px;
}

.user-table .coin-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.user-table .status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(92, 167, 255, 0.1);
    color: #d5e8ff;
    font-size: 11px;
    font-weight: 700;
}

.user-table .status-pill--low {
    background: rgba(207, 93, 93, 0.12);
    color: #ffc3c3;
}

.user-table .login-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-table .inspect-toggle {
    display: inline-flex;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.user-table .inspect-toggle img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.user-table__meta {
    color: var(--muted);
    font-size: 11px;
}

.role-tools {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: 10px;
}

.muted {
    color: var(--muted);
}


.modal-overlay[hidden] {
    display: none;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(4, 8, 16, 0.78);
    backdrop-filter: blur(4px);
}

.modal-card {
    position: relative;
    width: min(100%, 500px);
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
        rgba(13, 19, 29, 0.96);
    box-shadow: var(--shadow);
}

.modal-card--wide {
    width: min(100%, 1080px);
    max-height: calc(100vh - 48px);
    overflow: auto;
}

.modal-card h2 {
    margin-bottom: 18px;
    font-size: 16px;
}

.modal-form {
    display: flex;
    flex-direction: column;
}

.modal-role-id {
    color: #ff6a6a;
}

.modal-role-name {
    color: #8abfff;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 999px;
}

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

    .shell {
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .toolbar-search {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .toolbar-search__row--character,
    .toolbar-search__row--accounts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .inventory-grant-main {
        position: static;
    }

    .inventory-grant-filters,
    .inventory-grant-form {
        grid-template-columns: 1fr 1fr;
    }

    .inventory-search-card__row {
        grid-template-columns: 1fr 1fr;
    }

    .inventory-selection-grid {
        grid-template-columns: 1fr;
    }

    .referral-admin-row {
        grid-template-columns: 1fr;
    }

    .referral-admin-summary {
        grid-template-columns: 1fr;
    }

    .referral-admin-fields--compact {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .inventory-grant-form .field:nth-child(6) {
        grid-row: auto;
    }
}

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

    .topbar__inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 12px 14px;
    }

    .content {
        min-width: 0;
    }

    .sidebar {
        order: 2;
    }

    .page {
        order: 1;
    }

    .search-card__row {
        grid-template-columns: 1fr;
    }

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

    .toolbar-search__row--character,
    .toolbar-search__row--accounts {
        grid-template-columns: 1fr;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .detail-summary {
        grid-template-columns: 1fr 1fr;
    }

    .inventory-grant-filters,
    .inventory-grant-form {
        grid-template-columns: 1fr;
    }

    .inventory-search-card__row {
        grid-template-columns: 1fr;
    }

    .referral-admin-fields--compact {
        grid-template-columns: 1fr 1fr;
    }

    .inventory-lookup-card__header {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 720px) {
    .shell {
        padding: 12px;
        gap: 14px;
    }

    .topbar__inner {
        gap: 14px;
    }

    .topbar__brand {
        width: 100%;
        justify-content: space-between;
    }

    .topbar__actions {
        width: 100%;
        gap: 8px;
    }

    .topbar__chip,
    .topbar__badge {
        min-height: 30px;
        padding: 0 10px;
    }

    .toolbar-search {
        grid-template-columns: 1fr;
    }

    .brand--sidebar,
    .nav-section,
    .meta-card,
    .card,
    fieldset,
    .page-header {
        border-radius: 12px;
    }

    .page-header,
    .card,
    fieldset {
        padding: 14px;
    }

    .detail-summary {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .inline-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-card {
        width: 100%;
        padding: 18px;
        border-radius: 14px;
    }

    .settings-tabs {
        gap: 6px;
    }

    .settings-tabs__tab {
        flex: 1 1 calc(50% - 6px);
        border-radius: 10px;
    }

    .referral-admin-fields--compact {
        grid-template-columns: 1fr;
    }

    textarea {
        min-height: 320px;
    }
}

@media (max-width: 520px) {
    body {
        font-size: 12px;
    }

    .topbar__brand {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .topbar__logo {
        height: 36px;
    }

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

    .topbar__chip,
    .topbar__badge {
        justify-content: center;
        width: 100%;
    }

    .page-header h1,
    h2 {
        font-size: 16px;
    }

    .stat__value {
        font-size: 20px;
    }
}

.promo-layout {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
}

.promo-form-card {
    padding-top: 16px;
}

.promo-config-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(12, 18, 29, 0.82);
    border-radius: 14px;
    overflow: hidden;
}

.promo-config-table th,
.promo-config-table td {
    padding: 12px 14px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.promo-config-table tbody tr:last-child th,
.promo-config-table tbody tr:last-child td {
    border-bottom: 0;
}

.promo-config-table th {
    width: 190px;
    color: #f4f6fd;
    font-size: 16px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.03);
}

.promo-config-table td:nth-child(2) {
    width: 300px;
    background: rgba(255, 255, 255, 0.01);
}

.promo-config-table td:last-child {
    color: #ffd8df;
    font-size: 12px;
    line-height: 1.55;
    background: rgba(255, 255, 255, 0.015);
}

.promo-config-table input[type="text"],
.promo-config-table input[type="number"],
.promo-config-table textarea,
.promo-config-table select {
    border-color: rgba(123, 150, 196, 0.28);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(9, 14, 23, 0.98), rgba(7, 11, 18, 0.98));
    color: #f5f8ff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), inset 0 0 0 1px rgba(255, 255, 255, 0.015);
}

.promo-config-table textarea {
    min-height: 90px;
}

.promo-actions-row {
    justify-content: center;
    margin-top: 18px;
}

.promo-maintenance-card {
    margin-top: 18px;
}

.promo-maintenance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

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

.promo-form-grid__wide {
    grid-column: 1 / -1;
}

.promo-checkbox {
    margin-top: 22px;
}

.promo-list-toolbar {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
}

.promo-filter-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: end;
}

.promo-table code {
    color: #f7d68f;
    font-size: 12px;
    letter-spacing: 0.06em;
}

.promo-table td {
    vertical-align: middle;
}

.promo-table th:nth-child(10),
.promo-table td:nth-child(10) {
    width: 220px;
    max-width: 220px;
}

.promo-table td:nth-child(10) {
    white-space: normal;
    word-break: break-word;
    line-height: 1.45;
}

.promo-item-cell {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.promo-item-cell__icon,
.promo-item-input__icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    object-fit: contain;
    flex: 0 0 30px;
}

.promo-item-cell__placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    flex: 0 0 30px;
}

.promo-item-input {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.promo-item-input input {
    flex: 1 1 auto;
}

.promo-item-preview {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    color: #c6d7ff;
    font-size: 13px;
}

.promo-builder-row.is-collapsed {
    display: none;
}

.promo-builder-slot {
    display: grid;
    gap: 12px;
}

.promo-builder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.promo-builder-actions .is-hidden {
    display: none;
}

.promo-builder-panel {
    padding: 14px;
    border: 1px solid rgba(92, 167, 255, 0.14);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(92, 167, 255, 0.05), rgba(92, 167, 255, 0.015)),
        rgba(9, 14, 23, 0.5);
}

.promo-builder-panel.is-active {
    border-color: rgba(216, 169, 75, 0.3);
    box-shadow: 0 0 0 1px rgba(216, 169, 75, 0.12);
}

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

.promo-builder-grid__wide {
    grid-column: 1 / -1;
}

.promo-builder-grid .field {
    margin-bottom: 0;
}

.promo-builder-grid .field span {
    display: block;
    margin-bottom: 6px;
    color: #eef2fb;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

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

.promo-extra-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
        rgba(11, 17, 27, 0.86);
    overflow: hidden;
}

.promo-extra-card.is-active {
    border-color: rgba(216, 169, 75, 0.28);
    box-shadow:
        0 0 0 1px rgba(216, 169, 75, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.promo-extra-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
}

.promo-extra-card__title {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.promo-extra-card__eyebrow {
    color: #8fbaf5;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.promo-extra-card__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.promo-extra-card__panel {
    padding: 0 14px 14px;
}

.promo-extra-card__panel.is-collapsed {
    display: none;
}

.promo-item-preview--card {
    min-height: 28px;
}

.promo-management-split {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.9fr);
    gap: 18px;
    margin-top: 18px;
}

.promo-lookup-card {
    align-self: start;
}

.promo-item-results-table td:last-child,
.promo-item-results-table th:last-child {
    width: 70px;
    text-align: center;
}

.promo-item-results-table .js-promo-item-row {
    cursor: pointer;
}

.promo-item-results-table .js-promo-item-row:hover {
    background: rgba(58, 103, 176, 0.15);
}

.promo-row--used td {
    background: rgba(75, 179, 110, 0.08);
}

.promo-row--expired td {
    background: rgba(207, 93, 93, 0.08);
}

@media (max-width: 1180px) {
    .promo-layout,
    .promo-management-split,
    .promo-form-grid,
    .promo-filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .promo-maintenance-row {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 980px) {
    .promo-layout,
    .promo-management-split,
    .promo-form-grid,
    .promo-filter-grid {
        grid-template-columns: 1fr;
    }

    .promo-config-table,
    .promo-config-table tbody,
    .promo-config-table tr,
    .promo-config-table th,
    .promo-config-table td {
        display: block;
        width: 100%;
    }

    .promo-config-table th,
    .promo-config-table td {
        border-right: 0;
    }

    .promo-config-table th {
        padding-bottom: 6px;
    }

    .promo-config-table td {
        padding-top: 8px;
    }

    .promo-builder-grid {
        grid-template-columns: 1fr;
    }

    .promo-extra-card__header {
        align-items: stretch;
        flex-direction: column;
    }

    .promo-extra-card__actions,
    .promo-builder-actions {
        justify-content: stretch;
    }
}

.referral-cards {
    display: grid;
    gap: 18px;
}

.referral-card {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(91, 121, 176, 0.22);
    background: linear-gradient(180deg, rgba(25, 33, 47, 0.9), rgba(16, 22, 33, 0.96));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.referral-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.referral-card__header h3 {
    margin: 0 0 6px;
    color: #f4f7ff;
    font-size: 24px;
}

.referral-card__header p {
    margin: 0;
    color: #9bb4e6;
    font-size: 13px;
}

.referral-card__summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.referral-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(70, 94, 138, 0.2);
    color: #dce7ff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.referral-pill--bonus {
    background: rgba(195, 145, 54, 0.18);
    color: #ffd88a;
}

.referral-progress {
    display: grid;
    gap: 12px;
}

.referral-self-track {
    display: grid;
    gap: 14px;
}

.referral-track-grid {
    position: relative;
    display: grid;
    gap: 10px;
    align-items: start;
    min-width: 0;
    overflow-x: auto;
    padding: 14px 12px 10px;
}

.referral-track-grid__line {
    position: absolute;
    top: 22px;
    left: 20px;
    right: 20px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(49, 187, 255, 0.9), rgba(22, 137, 220, 0.92));
    box-shadow: 0 0 0 2px rgba(10, 24, 43, 0.65) inset;
}

.referral-track-step {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.referral-timeline__point {
    position: relative;
    display: flex;
    justify-content: center;
    width: 100%;
}

.referral-timeline__point::before {
    content: "";
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 4px solid #ffe600;
    background: #143b63;
    box-shadow: 0 0 0 3px rgba(7, 16, 29, 0.75);
}

.referral-timeline__point span {
    position: absolute;
    top: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(29, 43, 69, 0.96);
    color: #eef4ff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.referral-timeline__point.is-complete::before {
    background: #4fd17b;
    border-color: #dfff72;
}

.referral-timeline__point.is-complete span {
    color: #b9ffd0;
}

.referral-reward-card {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding: 8px 9px;
    border-radius: 12px;
    border: 2px solid rgba(197, 151, 70, 0.8);
    background: rgba(8, 14, 24, 0.68);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.referral-reward-card.is-complete {
    border-color: rgba(81, 177, 116, 0.95);
    box-shadow:
        0 0 0 1px rgba(81, 177, 116, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.referral-reward-card.is-pending {
    border-color: rgba(234, 200, 79, 0.95);
    box-shadow:
        0 0 0 1px rgba(234, 200, 79, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.referral-reward-card__body {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    min-width: 0;
}

.referral-progress__level {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(42, 59, 90, 0.32);
    color: #f3f6ff;
    font-weight: 800;
    font-size: 16px;
}

.referral-progress__reward {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.referral-progress__icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    flex: 0 0 24px;
}

.referral-progress__name {
    color: #f4f7ff;
    font-weight: 700;
    font-size: 10px;
    line-height: 1.2;
}

.referral-progress__meta {
    color: #9bb4e6;
    font-size: 9px;
    margin-top: 2px;
}

.referral-progress__state {
    text-align: right;
}

.referral-progress__state small {
    display: block;
    margin-top: 6px;
    color: #8ba2cf;
    font-size: 11px;
}

.referral-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.referral-state--done {
    background: rgba(67, 167, 100, 0.18);
    color: #8ff0ab;
}

.referral-state--todo {
    background: rgba(194, 141, 52, 0.18);
    color: #ffd789;
}

@media (max-width: 980px) {
    .referral-card__header {
        flex-direction: column;
    }

    .referral-card__summary {
        justify-content: flex-start;
    }

    .referral-track-grid {
        min-width: max-content;
    }
}

/* ── Disabled buttons ─────────────────────────────── */

input[readonly] {
    opacity: 0.7;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
}

button:disabled,
button[disabled],
.button-link:disabled,
.button-link[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    filter: saturate(0.3);
    pointer-events: none;
}

/* ── Focus-visible (keyboard accessibility) ────────── */

:focus-visible {
    outline: 2px solid rgba(92, 167, 255, 0.7);
    outline-offset: 2px;
}

button:focus-visible,
.button-link:focus-visible {
    outline: 2px solid rgba(216, 169, 75, 0.8);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(216, 169, 75, 0.15);
}

/* ── Flash messages (promo, etc.) ──────────────────── */

.flash {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
}

.flash--success {
    border: 1px solid rgba(75, 179, 110, 0.35);
    background: rgba(75, 179, 110, 0.1);
    color: #8ae4a5;
}

.flash--error {
    border: 1px solid rgba(207, 93, 93, 0.35);
    background: rgba(207, 93, 93, 0.1);
    color: #f5a3a3;
}

.flash--warning {
    border: 1px solid rgba(216, 169, 75, 0.35);
    background: rgba(216, 169, 75, 0.1);
    color: #ffd889;
}

/* ── Utility ───────────────────────────────────────── */

.input--uppercase {
    text-transform: uppercase;
}

/* --- Password visibility toggle --- */
.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 44px;
}

.password-peek {
    position: absolute;
    right: 1px;
    top: 1px;
    bottom: 1px;
    width: 40px;
    border: 0;
    border-radius: 0 9px 9px 0;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background 0.15s ease;
    padding: 0;
}

.password-peek:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f5f8ff;
}

.password-peek.is-visible {
    color: var(--accent);
    background: rgba(216, 169, 75, 0.08);
}

.password-peek::before {
    content: '';
    display: block;
    width: 18px;
    height: 18px;
    background: currentColor;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}

.password-peek.is-visible::before {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E");
}

/* ── Password Vault ── */

.vault-search__row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.vault-search__row .field {
    flex: 1;
    max-width: 400px;
}

.vault-search__submit {
    flex: 0 0 auto !important;
}

.vault-result__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.vault-result__field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.vault-result__field--password {
    grid-column: 1 / -1;
    padding-top: 1rem;
    border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

.vault-result__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.vault-result__value {
    font-size: 1rem;
}

.vault-result__password {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.vault-result__password code {
    font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    background: color-mix(in srgb, var(--panel) 80%, black);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: #ff6b6b;
    letter-spacing: 0.1em;
    user-select: all;
}

.vault-reveal-btn {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.vault-reveal-btn:hover {
    background: color-mix(in srgb, var(--accent) 30%, transparent);
    color: #fff;
}

.vault-result__no-password {
    color: var(--muted);
    font-style: italic;
}

.vault-result__not-found {
    color: #ff6b6b;
    padding: 1rem 0;
}

.vault-log__admin,
.vault-log__target {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
