@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/inter/inter-latin-700-normal.woff2") format("woff2"); }

:root {
    --ws-bg: #ffffff;
    --ws-sidebar: #f8f8f6;
    --ws-surface: #ffffff;
    --ws-text: #2c2c29;
    --ws-text-muted: #7a7975;
    --ws-text-faint: #a5a49f;
    --ws-border: #ebebe8;
    --ws-border-strong: #dcdcd8;
    --ws-hover: rgba(44, 44, 41, .06);
    --ws-active: rgba(44, 44, 41, .09);
    --ws-accent: #2b7de0;
    --ws-accent-hover: #1f6cc9;
    --ws-accent-soft: rgba(43, 125, 224, .12);
    --ws-danger: #d44c47;
    --ws-danger-soft: rgba(212, 76, 71, .12);
    --ws-success: #448361;
    --ws-success-soft: rgba(68, 131, 97, .14);
    --ws-warning: #cb912f;
    --ws-warning-soft: rgba(203, 145, 47, .16);
    --ws-shadow-menu: 0 0 0 1px rgba(15, 15, 15, .05), 0 3px 6px rgba(15, 15, 15, .1), 0 9px 24px rgba(15, 15, 15, .2);
    --ws-shadow-soft: 0 1px 2px rgba(15, 15, 15, .06);
    --ws-radius: 6px;
    --ws-radius-sm: 4px;
    --ws-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --ws-mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
    --ws-sidebar-width: 260px;
    --ws-topbar-height: 44px;
}

[data-theme="dark"] {
    --ws-bg: #1b1b1b;
    --ws-sidebar: #222221;
    --ws-surface: #252525;
    --ws-text: #e4e4e1;
    --ws-text-muted: #9a9995;
    --ws-text-faint: #6f6e6a;
    --ws-border: #313130;
    --ws-border-strong: #3d3d3b;
    --ws-hover: rgba(255, 255, 255, .06);
    --ws-active: rgba(255, 255, 255, .09);
    --ws-accent: #5aa0d6;
    --ws-accent-hover: #74b1e0;
    --ws-accent-soft: rgba(90, 160, 214, .16);
    --ws-danger: #e06b66;
    --ws-danger-soft: rgba(224, 107, 102, .16);
    --ws-success: #5fa57d;
    --ws-success-soft: rgba(95, 165, 125, .18);
    --ws-warning: #d9a54a;
    --ws-warning-soft: rgba(217, 165, 74, .18);
    --ws-shadow-menu: 0 0 0 1px rgba(255, 255, 255, .08), 0 3px 6px rgba(0, 0, 0, .4), 0 9px 24px rgba(0, 0, 0, .5);
    --ws-shadow-soft: 0 1px 2px rgba(0, 0, 0, .3);
}

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--ws-bg);
    color: var(--ws-text);
    font-family: var(--ws-font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--ws-text); text-decoration: none; }
a:hover { color: var(--ws-text); }
.ws-link { color: var(--ws-accent); }
.ws-link:hover { color: var(--ws-accent-hover); text-decoration: underline; }

::selection { background: var(--ws-accent-soft); }

:focus-visible { outline: 2px solid var(--ws-accent); outline-offset: 1px; border-radius: var(--ws-radius-sm); }

.ws-muted { color: var(--ws-text-muted) !important; }
.ws-faint { color: var(--ws-text-faint) !important; }
.ws-mono { font-family: var(--ws-mono); }

h1, h2, h3, h4, h5, h6 { color: var(--ws-text); font-weight: 600; letter-spacing: -.01em; }

.ws-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: var(--ws-radius);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    color: var(--ws-text);
    background: transparent;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
    white-space: nowrap;
}
.ws-btn:hover { background: var(--ws-hover); color: var(--ws-text); }
.ws-btn:disabled, .ws-btn.disabled { opacity: .5; pointer-events: none; }
.ws-btn-sm { height: 28px; padding: 0 8px; font-size: 13px; }
.ws-btn-icon { width: 28px; height: 28px; padding: 0; color: var(--ws-text-muted); }
.ws-btn-icon:hover { color: var(--ws-text); }
.ws-btn-primary { background: var(--ws-accent); color: #fff; }
.ws-btn-primary:hover { background: var(--ws-accent-hover); color: #fff; }
.ws-btn-outline { border-color: var(--ws-border-strong); background: var(--ws-surface); }
.ws-btn-outline:hover { background: var(--ws-hover); }
.ws-btn-quiet { color: var(--ws-text-muted); }
.ws-btn-danger { background: var(--ws-danger); color: #fff; }
.ws-btn-danger:hover { background: var(--ws-danger); color: #fff; filter: brightness(.94); }
.ws-btn-danger-outline { color: var(--ws-danger); border-color: var(--ws-danger-soft); }
.ws-btn-danger-outline:hover { background: var(--ws-danger-soft); color: var(--ws-danger); }
.ws-btn-block { width: 100%; height: 36px; }

.ws-input, .form-control, .form-select {
    height: 32px;
    padding: 4px 10px;
    border: 1px solid var(--ws-border-strong);
    border-radius: var(--ws-radius);
    background: var(--ws-surface);
    color: var(--ws-text);
    font-size: 14px;
    box-shadow: none;
}
textarea.ws-input, textarea.form-control { height: auto; min-height: 80px; padding: 8px 10px; }
.ws-input:focus, .form-control:focus, .form-select:focus {
    border-color: var(--ws-accent);
    box-shadow: 0 0 0 3px var(--ws-accent-soft);
    background: var(--ws-surface);
    color: var(--ws-text);
}
.ws-input::placeholder, .form-control::placeholder { color: var(--ws-text-faint); }
.ws-input-lg { height: 38px; font-size: 15px; }

.ws-label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 500; color: var(--ws-text-muted); }
.ws-field { margin-bottom: 14px; }
.ws-field-error { margin-top: 4px; font-size: 12px; color: var(--ws-danger); }
.ws-input-wrap { position: relative; }
.ws-input-wrap .ws-input-action { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }

.form-check-input { border-color: var(--ws-border-strong); background-color: var(--ws-surface); }
.form-check-input:checked { background-color: var(--ws-accent); border-color: var(--ws-accent); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--ws-accent-soft); border-color: var(--ws-accent); }

.ws-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--ws-radius-sm);
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    background: var(--ws-active);
    color: var(--ws-text);
}
.ws-pill-success { background: var(--ws-success-soft); color: var(--ws-success); }
.ws-pill-danger { background: var(--ws-danger-soft); color: var(--ws-danger); }
.ws-pill-warning { background: var(--ws-warning-soft); color: var(--ws-warning); }
.ws-pill-accent { background: var(--ws-accent-soft); color: var(--ws-accent); }
.ws-pill-muted { background: var(--ws-active); color: var(--ws-text-muted); }
.ws-pill .ws-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.ws-kbd { padding: 1px 5px; border: 1px solid var(--ws-border-strong); border-radius: var(--ws-radius-sm); font-size: 11px; color: var(--ws-text-muted); font-family: var(--ws-font); }

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

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

.ws-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    width: var(--ws-sidebar-width);
    background: var(--ws-sidebar);
    border-right: 1px solid var(--ws-border);
    transition: transform .2s ease;
}
[data-sidebar="collapsed"] .ws-sidebar { transform: translateX(-100%); }

.ws-sidebar-head { padding: 8px 8px 4px; }
.ws-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 36px;
    padding: 0 8px;
    border: 0;
    border-radius: var(--ws-radius);
    background: transparent;
    color: var(--ws-text);
    font-weight: 600;
    text-align: left;
}
.ws-switcher:hover { background: var(--ws-hover); }
.ws-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: var(--ws-text);
    color: var(--ws-bg);
    font-size: 12px;
    font-weight: 700;
}
.ws-logo-lg { width: 40px; height: 40px; border-radius: 9px; font-size: 20px; }

.ws-sidebar-search { padding: 2px 8px 8px; }
.ws-sidebar-search .ws-input { height: 28px; padding-left: 28px; background: var(--ws-bg); border-color: var(--ws-border); font-size: 13px; }
.ws-sidebar-search .bi { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: var(--ws-text-faint); font-size: 13px; }

.ws-sidebar-scroll { flex: 1 1 auto; overflow-y: auto; padding: 0 8px 12px; }
.ws-nav-section { margin: 14px 8px 4px; font-size: 11px; font-weight: 600; color: var(--ws-text-faint); letter-spacing: .02em; }
.ws-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 30px;
    padding: 0 8px;
    border-radius: var(--ws-radius);
    color: var(--ws-text-muted);
    font-size: 14px;
    font-weight: 500;
}
.ws-nav-item .bi { width: 18px; text-align: center; font-size: 15px; color: var(--ws-text-faint); }
.ws-nav-item:hover { background: var(--ws-hover); color: var(--ws-text); }
.ws-nav-item.is-active { background: var(--ws-active); color: var(--ws-text); font-weight: 600; }
.ws-nav-item.is-active .bi { color: var(--ws-text); }

.ws-sidebar-foot { padding: 8px; border-top: 1px solid var(--ws-border); }

.ws-main {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: var(--ws-sidebar-width);
    transition: margin-left .2s ease;
}
[data-sidebar="collapsed"] .ws-main { margin-left: 0; }

.ws-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: 6px;
    height: var(--ws-topbar-height);
    padding: 0 12px;
    background: var(--ws-bg);
}
.ws-breadcrumb { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 14px; color: var(--ws-text-muted); }
.ws-breadcrumb a, .ws-breadcrumb span { padding: 2px 6px; border-radius: var(--ws-radius-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-breadcrumb a { color: var(--ws-text-muted); }
.ws-breadcrumb a:hover { background: var(--ws-hover); color: var(--ws-text); }
.ws-breadcrumb .is-current { color: var(--ws-text); }
.ws-topbar-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }

.ws-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--ws-active);
    color: var(--ws-text);
    font-size: 11px;
    font-weight: 600;
}

.ws-page { max-width: 1100px; margin: 0 auto; padding: 36px 48px 80px; }
.ws-page-narrow { max-width: 720px; }
.ws-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.ws-page-title { margin: 0; font-size: 32px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }
.ws-page-subtitle { margin: 6px 0 0; color: var(--ws-text-muted); font-size: 14px; }
.ws-page-icon { display: block; margin-bottom: 8px; font-size: 40px; line-height: 1; color: var(--ws-text-muted); }

.dropdown-menu {
    padding: 4px;
    border: 0;
    border-radius: var(--ws-radius);
    background: var(--ws-surface);
    box-shadow: var(--ws-shadow-menu);
    font-size: 14px;
    min-width: 220px;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 30px;
    padding: 0 8px;
    border-radius: var(--ws-radius-sm);
    color: var(--ws-text);
}
.dropdown-item .bi { width: 16px; color: var(--ws-text-muted); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--ws-hover); color: var(--ws-text); }
.dropdown-item.text-danger, .dropdown-item.text-danger .bi { color: var(--ws-danger) !important; }
.dropdown-divider { margin: 4px 0; border-color: var(--ws-border); }
.dropdown-header { padding: 6px 8px 4px; font-size: 12px; color: var(--ws-text-muted); }

.offcanvas { background: var(--ws-surface); color: var(--ws-text); border-color: var(--ws-border) !important; }
.ws-peek { width: 520px !important; max-width: 100vw; box-shadow: var(--ws-shadow-menu); }
.ws-peek .offcanvas-header { gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--ws-border); }
.ws-peek-title { margin: 0; font-size: 16px; font-weight: 600; }
.ws-peek .offcanvas-body { padding: 20px 24px; }
.ws-peek-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 24px; border-top: 1px solid var(--ws-border); }

.ws-props { display: grid; grid-template-columns: 160px 1fr; align-items: center; gap: 6px 12px; margin-bottom: 14px; }
.ws-props > .ws-prop-label { display: flex; align-items: center; gap: 6px; min-height: 32px; color: var(--ws-text-muted); font-size: 14px; }
.ws-props > .ws-prop-label .bi { font-size: 14px; color: var(--ws-text-faint); }
.ws-props > .ws-prop-value { min-width: 0; }

.ws-card {
    padding: 16px;
    border: 1px solid var(--ws-border);
    border-radius: var(--ws-radius);
    background: var(--ws-surface);
}

.ws-empty { padding: 48px 16px; text-align: center; color: var(--ws-text-muted); }
.ws-empty .bi { display: block; margin-bottom: 8px; font-size: 28px; color: var(--ws-text-faint); }

.ws-skeleton { display: block; height: 14px; border-radius: var(--ws-radius-sm); background: linear-gradient(90deg, var(--ws-hover), var(--ws-active), var(--ws-hover)); background-size: 200% 100%; animation: ws-shimmer 1.2s ease infinite; }
@keyframes ws-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.ws-block-msg { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: var(--ws-radius); background: var(--ws-surface); color: var(--ws-text); box-shadow: var(--ws-shadow-menu); font-size: 14px; }

.submit-error.no-bullets { margin: 0; padding: 0; list-style: none; }

.ws-pw-checks { margin: 6px 0 0; padding: 0; list-style: none; font-size: 12px; color: var(--ws-text-muted); }
.ws-pw-checks li { display: flex; align-items: center; gap: 6px; line-height: 1.8; }
.ws-pw-checks li.is-ok { color: var(--ws-success); }

.ws-recovery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.ws-recovery-grid code { display: block; padding: 6px; border-radius: var(--ws-radius-sm); background: var(--ws-hover); color: var(--ws-text); font-size: 14px; letter-spacing: .04em; }

.swal2-popup.ws-swal { width: 420px; padding: 24px; border-radius: 10px; background: var(--ws-surface); color: var(--ws-text); box-shadow: var(--ws-shadow-menu); font-family: var(--ws-font); }
.ws-swal .swal2-icon { transform: scale(.7); margin: 0 auto 4px; }
.ws-swal-title { padding: 0; font-size: 18px; font-weight: 600; color: var(--ws-text); }
.ws-swal-body { margin: 8px 0 0; font-size: 14px; color: var(--ws-text-muted); }
.ws-swal-actions { gap: 8px; margin-top: 20px; }
.ws-swal-errors { margin: 0; padding-left: 18px; text-align: left; color: var(--ws-text); }
.ws-swal-validation-msg { background: var(--ws-danger-soft) !important; color: var(--ws-danger) !important; }
.ws-swal-in { animation: ws-pop .14s ease-out; }
.ws-swal-out { animation: ws-fade .1s ease-in forwards; }
@keyframes ws-pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes ws-fade { to { opacity: 0; } }

.swal2-popup.ws-toast { padding: 10px 12px !important; border-radius: var(--ws-radius) !important; background: var(--ws-text) !important; box-shadow: var(--ws-shadow-menu) !important; }
.ws-toast .swal2-icon { display: none !important; }
.ws-toast-title { margin: 0 !important; font-size: 14px !important; font-weight: 500 !important; color: var(--ws-bg) !important; }
.ws-toast-close { color: var(--ws-bg) !important; opacity: .6; }
.ws-toast-error .ws-toast-title::before { content: "\F33A"; font-family: "bootstrap-icons"; margin-right: 6px; color: #f28b86; }
.ws-toast-success .ws-toast-title::before { content: "\F26A"; font-family: "bootstrap-icons"; margin-right: 6px; color: #7fcf9f; }

.ws-sidebar-backdrop { display: none; }

@media (max-width: 767.98px) {
    .ws-sidebar { transform: translateX(-100%); box-shadow: var(--ws-shadow-menu); }
    .ws-sidebar-open .ws-sidebar { transform: none; }
    .ws-sidebar-open .ws-sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 1025; background: rgba(0, 0, 0, .3); }
    .ws-main { margin-left: 0 !important; }
    .ws-page { padding: 20px 16px 64px; }
    .ws-page-title { font-size: 26px; }
    .ws-page-head { flex-wrap: wrap; align-items: flex-start; }
    .ws-props { grid-template-columns: 1fr; gap: 2px; }
    .ws-props > .ws-prop-label { min-height: 0; margin-top: 8px; }
    .ws-peek { width: 100vw !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.ws-skeleton-num { width: 40px; height: 28px; }
.ws-topbar-name { max-width: 140px; }
.ws-emoji-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-emoji-choice { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--ws-border); border-radius: var(--ws-radius); cursor: pointer; font-size: 20px; }
.ws-emoji-choice input { position: absolute; opacity: 0; pointer-events: none; }
.ws-emoji-choice:has(input:checked) { border-color: var(--ws-accent); background: var(--ws-accent-soft); }
