* { box-sizing: border-box; }
:root {
    --border: #e7e7e7;
    --text: #1f2933;
    --muted: #6b7280;
    --bg: #ffffff;
    --soft: #f7f7f7;
    --black: #0b0b0b;
    --danger: #9f1d1d;
}
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
}
button, input, select, textarea {
    font: inherit;
}
button, .secondary-link {
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    background: #111827;
    color: white;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}
button:hover, .secondary-link:hover { opacity: .9; }
button.secondary, .secondary-link {
    background: #f1f1f1;
    color: #111827;
    border: 1px solid var(--border);
}
button.danger { background: var(--danger); color: white; }
button.icon-button {
    width: 42px;
    height: 42px;
    padding: 0;
    background: #f6f6f6;
    color: #111827;
    border: 1px solid var(--border);
}
.inline { display: inline; }
.muted { color: var(--muted); margin: 4px 0 0; }
.alert, .global-alert {
    background: #fff4f4;
    border: 1px solid #ffd0d0;
    color: #8a1f1f;
    padding: 10px 12px;
    border-radius: 10px;
    margin: 12px 0;
}
.global-alert { margin: 10px 16px; }

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #fafafa;
}
.login-card {
    width: min(420px, calc(100vw - 32px));
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: white;
    box-shadow: 0 20px 60px rgba(0,0,0,.06);
}
.login-card h1 { margin: 0; }
.login-card label {
    display: block;
    margin-top: 18px;
    margin-bottom: 6px;
    font-weight: 600;
}
.login-card input, .type-form input, .type-row input, .modal input, .modal select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 12px;
    background: white;
}
.login-card button { width: 100%; margin-top: 20px; }

.topbar {
    height: 62px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    position: sticky;
    top: 0;
    background: white;
    z-index: 20;
}
.brand {
    color: #111827;
    font-weight: 700;
    text-decoration: none;
    margin-right: auto;
}
.top-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.top-actions.collapsed { display: none; }

.layout {
    display: grid;
    grid-template-columns: 310px 1fr;
    min-height: calc(100vh - 62px);
}
.sidebar {
    border-right: 1px solid var(--border);
    height: calc(100vh - 62px);
    position: sticky;
    top: 62px;
    display: flex;
    flex-direction: column;
    background: white;
}
.filter-box {
    padding: 14px;
    border-bottom: 1px solid var(--border);
}
.search-wrap {
    position: relative;
    margin-bottom: 10px;
}
.search-wrap i {
    position: absolute;
    left: 11px;
    top: 12px;
    color: var(--muted);
}
.search-wrap input, .filter-box select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 12px;
}
.search-wrap input { padding-left: 36px; }
.doc-list {
    overflow: auto;
    padding: 8px;
    flex: 1;
}
.doc-link {
    display: block;
    padding: 12px;
    border-radius: 12px;
    color: #111827;
    text-decoration: none;
    border: 1px solid transparent;
}
.doc-link:hover { background: #f7f7f7; }
.doc-link.active {
    background: #f1f5f9;
    border-color: #dbe3ef;
}
.doc-link span { display: block; font-weight: 650; }
.doc-link small { color: var(--muted); display: block; margin-top: 3px; }
.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 12px 14px;
    color: var(--muted);
    font-size: 14px;
}
.editor-area {
    padding: 18px;
    min-width: 0;
}
.document-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 14px;
}
.document-toolbar h1 { margin: 0; font-size: 24px; }
.document-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.editor-form {
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    background: var(--black);
}
.markdown-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px;
    background: #151515;
    border-bottom: 1px solid #2b2b2b;
}
.markdown-bar button {
    padding: 7px 10px;
    background: #272727;
    border: 1px solid #3a3a3a;
}
.markdown-bar .save-button {
    margin-left: auto;
    background: white;
    color: #111827;
}
.status {
    color: #cbd5e1;
    font-size: 14px;
}
.status.dirty { color: #fbbf24; }
.status.clean { color: #86efac; }
textarea#editor {
    width: 100%;
    min-height: calc(100vh - 240px);
    resize: vertical;
    border: 0;
    outline: 0;
    padding: 22px;
    background: var(--black);
    color: white;
    font-family: Consolas, "Cascadia Mono", "Courier New", monospace;
    font-size: 16px;
    line-height: 1.65;
}
.empty-state {
    min-height: 60vh;
    display: grid;
    place-content: center;
    text-align: center;
}
.types-page {
    padding: 26px;
}
.panel {
    max-width: 900px;
    margin: 0 auto;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    background: white;
}
.section-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}
.section-head h1 { margin: 0; }
.type-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-bottom: 18px;
}
.type-list { display: grid; gap: 10px; }
.type-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: center;
}
.badge {
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 8px 10px;
    border-radius: 999px;
}
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 16px;
}
.modal.open { display: flex; }
.modal-card {
    width: min(520px, 100%);
    background: white;
    border-radius: 18px;
    padding: 24px;
    position: relative;
    box-shadow: 0 30px 80px rgba(0,0,0,.25);
}
.modal-card h2 { margin-top: 0; }
.modal-card label {
    display: block;
    font-weight: 650;
    margin: 14px 0 6px;
}
.modal-close {
    position: absolute;
    right: 12px;
    top: 12px;
    border-radius: 999px;
    width: 34px;
    height: 34px;
    padding: 0;
    background: #f2f2f2;
    color: #111827;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar {
        position: static;
        height: auto;
        max-height: 45vh;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
    .top-actions {
        position: absolute;
        top: 62px;
        right: 12px;
        left: 12px;
        padding: 12px;
        background: white;
        border: 1px solid var(--border);
        border-radius: 14px;
        box-shadow: 0 20px 60px rgba(0,0,0,.08);
        flex-wrap: wrap;
    }
    .document-toolbar { flex-direction: column; }
    .type-form, .type-row { grid-template-columns: 1fr; }
}


/* NOTAS_TUSINNOS_BIDIRECTIONAL_EDITOR_V1 */
.nt-editor-tabs {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 12px 0 12px;
    background: #141414;
    border-bottom: 1px solid #2b2b2b;
}

.nt-editor-tab {
    appearance: none;
    border: 1px solid #3a3a3a;
    background: #222;
    color: #f5f5f5;
    border-radius: 10px 10px 0 0;
    padding: 9px 16px;
    font: inherit;
    cursor: pointer;
}

.nt-editor-tab.is-active {
    background: #ffffff;
    color: #111827;
    border-color: #ffffff;
}

.nt-rich-editor {
    min-height: 58vh;
    padding: 28px 30px;
    background: #070707;
    color: #f8fafc;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.68;
    overflow: auto;
    outline: none;
    white-space: normal;
}

.nt-rich-editor:focus {
    box-shadow: inset 0 0 0 2px rgba(212, 175, 55, .35);
}

.nt-rich-editor h1 {
    margin: 0 0 20px 0;
    font-size: 2rem;
    line-height: 1.2;
    font-weight: 800;
}

.nt-rich-editor h2 {
    margin: 28px 0 16px 0;
    font-size: 1.55rem;
    line-height: 1.25;
    font-weight: 750;
}

.nt-rich-editor h3 {
    margin: 24px 0 12px 0;
    font-size: 1.25rem;
    line-height: 1.3;
    font-weight: 700;
}

.nt-rich-editor p {
    margin: 0 0 14px 0;
    max-width: 980px;
}

.nt-rich-editor strong,
.nt-rich-editor b {
    font-weight: 800;
}

.nt-rich-editor em,
.nt-rich-editor i {
    font-style: italic;
}

.nt-rich-editor code {
    padding: 2px 5px;
    border-radius: 5px;
    background: #1f2937;
    color: #f9fafb;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.nt-rich-editor ul,
.nt-rich-editor ol {
    margin: 0 0 16px 24px;
    padding: 0;
}

.nt-rich-editor li {
    margin: 6px 0;
}

.nt-editor-source textarea {
    width: 100%;
    min-height: 58vh;
}


/* NOTAS_TUSINNOS_SCROLL_TOP_CSS_V2 */
#work-scroll-top.work-scroll-top {
    position: fixed !important;
    right: 24px !important;
    bottom: 24px !important;
    z-index: 2147483647 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(255, 255, 255, .24) !important;
    background: #111 !important;
    color: #fff !important;
    font-family: Arial, sans-serif !important;
    font-size: 28px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .38) !important;
    opacity: 0 !important;
    transform: translateY(12px) !important;
    pointer-events: none !important;
    transition: opacity .18s ease, transform .18s ease, background .18s ease !important;
}

#work-scroll-top.work-scroll-top.is-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

#work-scroll-top.work-scroll-top:hover {
    background: #222 !important;
}

@media (max-width: 720px) {
    #work-scroll-top.work-scroll-top {
        right: 14px !important;
        bottom: 14px !important;
        width: 44px !important;
        height: 44px !important;
        font-size: 25px !important;
    }
}

