:root {
    --ws-bg: #050505;
    --ws-panel: #101010;
    --ws-panel-soft: #161616;
    --ws-panel-raised: #1d1d1f;
    --ws-border: rgba(255, 255, 255, 0.09);
    --ws-border-strong: rgba(255, 255, 255, 0.16);
    --ws-text: #ffffff;
    --ws-muted: rgba(255, 255, 255, 0.58);
    --ws-subtle: rgba(255, 255, 255, 0.36);
    --ws-accent: #8b7cff;
    --ws-cyan: #3fb7ff;
    --ws-success: #27c084;
    --ws-warning: #ffb454;
    --ws-danger: #ff4d4d;
    --ws-radius: 7px;
    --ws-font: "Montserrat", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    min-height: 100%;
    background: var(--ws-bg);
    color: var(--ws-text);
    font-family: var(--ws-font);
    letter-spacing: 0;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--ws-bg);
    color: var(--ws-text);
    font-size: 14px;
}

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

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

input,
textarea,
select {
    width: 100%;
    min-height: 36px;
    border: 1px solid var(--ws-border);
    border-radius: var(--ws-radius);
    background: rgba(255, 255, 255, 0.045);
    color: var(--ws-text);
    outline: none;
    padding: 0 11px;
    font-size: 13px;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

textarea {
    min-height: 180px;
    padding: 13px;
    resize: vertical;
}

select {
    color-scheme: dark;
}

select option {
    background: #151515;
    color: var(--ws-text);
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(139, 124, 255, 0.75);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px rgba(139, 124, 255, 0.14);
}

label {
    display: grid;
    gap: 6px;
    color: var(--ws-muted);
    font-size: 12px;
    font-weight: 500;
}

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

th,
td {
    border-bottom: 1px solid var(--ws-border);
    padding: 11px;
    text-align: left;
    vertical-align: top;
}

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

.eyebrow {
    margin: 0 0 5px;
    color: var(--ws-accent);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

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

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(139, 124, 255, 0.45);
    border-radius: var(--ws-radius);
    background: rgba(139, 124, 255, 0.12);
    color: #d8d1ff;
    font-weight: 700;
}

.brand-mark.small {
    width: 28px;
    height: 28px;
    font-size: 12px;
}

.btn,
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    border: 1px solid var(--ws-border);
    border-radius: var(--ws-radius);
    background: rgba(255, 255, 255, 0.06);
    color: var(--ws-text);
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.btn {
    padding: 0 13px;
    font-weight: 600;
    font-size: 13px;
}

.btn:hover,
.icon-btn:hover {
    border-color: var(--ws-border-strong);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.btn.primary {
    border-color: rgba(139, 124, 255, 0.6);
    background: var(--ws-accent);
    color: #fff;
}

.btn.ghost {
    background: transparent;
}

.btn.danger,
.icon-btn.danger:hover {
    border-color: rgba(255, 77, 77, 0.45);
    background: rgba(255, 77, 77, 0.13);
    color: #ffb3b3;
}

.btn.compact {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
}

.btn.full {
    width: 100%;
}

.icon-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    flex: 0 0 auto;
}

.icon-btn.subtle {
    background: transparent;
}

.icon-btn svg,
.btn svg {
    width: 16px;
    height: 16px;
}

.stack-form {
    display: grid;
    gap: 11px;
}

.stack-form.compact-form {
    gap: 10px;
}

.inline-form {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

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

.form-divider {
    height: 1px;
    background: var(--ws-border);
    margin: 4px 0;
}

.notice {
    border: 1px solid var(--ws-border);
    border-radius: var(--ws-radius);
    padding: 12px 13px;
    margin-bottom: 14px;
    color: var(--ws-muted);
    background: rgba(255, 255, 255, 0.045);
}

.notice.success {
    border-color: rgba(39, 192, 132, 0.36);
    background: rgba(39, 192, 132, 0.1);
    color: #9ff0ce;
}

.notice.danger {
    border-color: rgba(255, 77, 77, 0.36);
    background: rgba(255, 77, 77, 0.1);
    color: #ffb7b7;
}

.notice.warning {
    border-color: rgba(255, 180, 84, 0.38);
    background: rgba(255, 180, 84, 0.1);
    color: #ffdfb3;
}

.code-preview {
    overflow: auto;
    max-height: 260px;
    margin-top: 16px;
    border: 1px solid var(--ws-border);
    border-radius: var(--ws-radius);
    padding: 14px;
    background: #080808;
    color: #d6d6d6;
}

@media (max-width: 760px) {
    .form-grid.two {
        grid-template-columns: 1fr;
    }
}

/* Kanban reference UI system */
:root {
    --ws-bg: #0b1220;
    --ws-bg-deep: #070d18;
    --ws-panel: #1a2436;
    --ws-panel-soft: #202b3e;
    --ws-panel-raised: #243047;
    --ws-sidebar: #0e1729;
    --ws-border: #2b3650;
    --ws-border-strong: #3a4864;
    --ws-text: #f4f7ff;
    --ws-muted: #96a4ba;
    --ws-subtle: #6f7d95;
    --ws-accent: #8b7cff;
    --ws-cyan: #48b8ff;
    --ws-success: #2dd4a4;
    --ws-warning: #ffc857;
    --ws-danger: #ff5d6c;
    --ws-pink: #ff6db6;
    --ws-radius: 8px;
    --ws-shadow: 0 18px 50px rgba(0, 0, 0, 0.26);
}

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

body {
    background:
        radial-gradient(circle at 18% -10%, rgba(139, 124, 255, 0.14), transparent 28%),
        radial-gradient(circle at 88% 4%, rgba(72, 184, 255, 0.09), transparent 25%),
        linear-gradient(180deg, var(--ws-bg) 0%, var(--ws-bg-deep) 100%);
    color: var(--ws-text);
    font-size: 13px;
}

input,
textarea,
select {
    min-height: 38px;
    border-color: var(--ws-border);
    border-radius: 7px;
    background: rgba(12, 19, 34, 0.74);
    color: var(--ws-text);
    font-size: 13px;
}

textarea {
    min-height: 160px;
}

select option {
    background: #151f31;
    color: var(--ws-text);
}

input:hover,
textarea:hover,
select:hover {
    border-color: var(--ws-border-strong);
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(139, 124, 255, 0.72);
    background: rgba(14, 23, 41, 0.96);
    box-shadow: 0 0 0 3px rgba(139, 124, 255, 0.14);
}

input::placeholder,
textarea::placeholder {
    color: #708097;
}

label {
    color: var(--ws-muted);
    font-size: 12px;
    font-weight: 600;
}

table {
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    border-bottom: 1px solid var(--ws-border);
    padding: 12px 14px;
}

th {
    background: rgba(13, 22, 38, 0.64);
    color: #a7b3c8;
    font-size: 11px;
    letter-spacing: 0;
}

tbody tr {
    transition: background .16s ease, border-color .16s ease;
}

tbody tr:hover {
    background: rgba(139, 124, 255, 0.05);
}

.eyebrow {
    color: var(--ws-accent);
    font-size: 11px;
    font-weight: 800;
}

.brand-mark {
    border-radius: 9px;
    border-color: rgba(139, 124, 255, 0.42);
    background: rgba(139, 124, 255, 0.16);
    color: #ded9ff;
}

.btn,
.icon-btn {
    border-color: var(--ws-border);
    border-radius: 7px;
    background: rgba(32, 43, 62, 0.78);
    color: var(--ws-text);
    box-shadow: none;
    font-weight: 700;
}

.btn:hover,
.icon-btn:hover {
    border-color: var(--ws-border-strong);
    background: rgba(42, 55, 78, 0.94);
    transform: translateY(-1px);
}

.btn.primary {
    border-color: rgba(139, 124, 255, 0.72);
    background: var(--ws-accent);
    color: #ffffff;
}

.btn.secondary {
    border-color: rgba(72, 184, 255, 0.36);
    background: rgba(72, 184, 255, 0.13);
    color: #78caff;
}

.btn.ghost,
.icon-btn.subtle {
    background: transparent;
}

.btn.danger,
.icon-btn.danger {
    border-color: rgba(255, 93, 108, 0.34);
    background: rgba(255, 93, 108, 0.1);
    color: #ff7d88;
}

.btn.danger:hover,
.icon-btn.danger:hover {
    border-color: rgba(255, 93, 108, 0.56);
    background: rgba(255, 93, 108, 0.16);
    color: #ff9aa3;
}

.btn.compact {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
}

.icon-btn {
    width: 36px;
    height: 36px;
}

.icon-btn svg,
.btn svg {
    width: 16px;
    height: 16px;
}

.badge,
.status {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ws-border);
    border-radius: 7px;
    padding: 0 9px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--ws-muted);
    font-size: 11px;
    font-weight: 800;
}

.badge.primary,
.status.admin {
    border-color: rgba(139, 124, 255, 0.35);
    background: rgba(139, 124, 255, 0.13);
    color: #b9b0ff;
}

.badge.success,
.status.active {
    border-color: rgba(45, 212, 164, 0.35);
    background: rgba(45, 212, 164, 0.11);
    color: #58e5bb;
}

.badge.warning,
.status.blocked {
    border-color: rgba(255, 200, 87, 0.34);
    background: rgba(255, 200, 87, 0.11);
    color: #ffd56f;
}

.badge.danger {
    border-color: rgba(255, 93, 108, 0.34);
    background: rgba(255, 93, 108, 0.1);
    color: #ff7d88;
}

.dropdown,
.action-menu {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 20;
    display: none;
    min-width: 184px;
    border: 1px solid var(--ws-border);
    border-radius: 8px;
    background: #202b3e;
    padding: 6px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.32);
}

.dropdown.open .dropdown-menu,
.action-menu.open .dropdown-menu {
    display: grid;
    gap: 2px;
}

.dropdown-item {
    display: flex;
    width: 100%;
    min-height: 34px;
    align-items: center;
    gap: 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ws-muted);
    cursor: pointer;
    padding: 0 10px;
    text-align: left;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
}

.dropdown-item:hover {
    background: rgba(139, 124, 255, 0.12);
    color: var(--ws-text);
}

.dropdown-item.danger {
    color: #ff8b95;
}

.dropdown-item svg {
    width: 15px;
    height: 15px;
}

.notice {
    border-color: var(--ws-border);
    border-radius: 8px;
    background: rgba(32, 43, 62, 0.82);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(3, 7, 15, 0.72);
    backdrop-filter: blur(8px);
}

.modal-backdrop[hidden] {
    display: none !important;
}

.modal {
    width: min(460px, 100%);
    border-color: var(--ws-border);
    border-radius: 10px;
    background: #202b3e;
    padding: 18px;
    box-shadow: 0 24px 90px rgba(0, 0, 0, 0.44);
}

.modal h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

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

.modal p:empty {
    display: none;
}

.modal-fields {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.toast-zone {
    position: fixed;
    z-index: 70;
    display: grid;
    width: min(360px, calc(100vw - 36px));
    gap: 10px;
    right: 18px;
    bottom: 18px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    border-color: var(--ws-border);
    border-radius: 8px;
    background: #202b3e;
    color: var(--ws-text);
}

.toast::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--ws-success);
    box-shadow: 0 0 0 4px rgba(45, 212, 164, 0.13);
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--ws-border);
    border-radius: 10px;
    background: rgba(26, 36, 54, 0.72);
}

/* Compact typography pass */
body,
input,
textarea,
select,
button {
    font-weight: 400;
}

label,
.btn,
.icon-btn,
.dropdown-item,
.badge,
.status,
.notice,
.auth-links,
.sidebar-nav a,
.admin-sidebar .sidebar-nav a {
    font-weight: 500;
}

h1,
h2,
h3,
h4,
h5,
h6,
.eyebrow,
.island-title-input,
.admin-header h1,
.workspace-header h1,
.auth-card h2,
.auth-brand h1 {
    font-weight: 700;
}

.btn {
    min-height: 34px;
    padding: 0 11px;
    font-size: 12px;
}

.icon-btn {
    width: 32px;
    height: 32px;
}

input,
textarea,
select {
    min-height: 34px;
    padding-right: 10px;
    padding-left: 10px;
}

.dropdown-item {
    min-height: 32px;
    font-size: 12px;
}
