:root {
    --bg-main: #0a1020;
    --bg-header: #050b18;
    --bg-card: #111a2c;
    --bg-card-light: #17223a;
    --bg-input: #0d1526;

    --border-soft: rgba(148, 163, 184, 0.18);
    --border-strong: rgba(129, 140, 248, 0.45);

    --text-main: #f8fafc;
    --text-muted: #a8b3c7;
    --text-soft: #cbd5e1;

    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-dark: #312e81;

    --danger: #ef4444;
    --success: #22c55e;

    --radius-lg: 18px;
    --radius-md: 12px;
    --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, rgba(99, 102, 241, 0.18), transparent 32%),
        radial-gradient(circle at top right, rgba(30, 41, 59, 0.9), transparent 35%),
        linear-gradient(135deg, #060b16 0%, #0a1020 45%, #111827 100%);
}

/* Layout */

.devbook-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
}

.devbook-header {
    background: rgba(5, 11, 24, 0.92);
    border-bottom: 1px solid var(--border-soft);
    backdrop-filter: blur(16px);
    padding: 22px 0;
    position: sticky;
    top: 0;
    z-index: 20;
}

.devbook-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.devbook-logo i {
    color: var(--accent-light);
    font-size: 2.25rem;
}

main {
    padding-top: 40px !important;
    padding-bottom: 80px !important;
}

/* Cards */

.devbook-card {
    background:
        linear-gradient(145deg, rgba(17, 26, 44, 0.96), rgba(12, 19, 34, 0.96));
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 32px;
    margin-bottom: 36px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
}

.section-title i {
    font-size: 2rem;
    color: var(--accent-light);
}

.section-title h1,
.results-header h2 {
    margin: 0;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 26px;
}

/* Forms */

.form-label {
    color: var(--text-soft);
    font-weight: 700;
    margin-bottom: 8px;
}

.search-input-wrapper {
    position: relative;
}

.search-input-wrapper > i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.25rem;
}

.devbook-input {
    height: 62px;
    padding-left: 54px;
    padding-right: 52px;
    color: var(--text-main);
    background: var(--bg-input);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: var(--radius-md);
}

.devbook-input::placeholder {
    color: var(--text-muted);
}

.devbook-input:focus,
.devbook-select:focus {
    color: var(--text-main);
    background: var(--bg-input);
    border-color: var(--accent-light);
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.2);
}

.clear-search {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
}

.clear-search:hover {
    color: var(--text-main);
}

.devbook-select {
    height: 54px;
    color: var(--text-main);
    background-color: var(--bg-input);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: var(--radius-md);
}

.devbook-select option {
    background: var(--bg-card);
    color: var(--text-main);
}

/* Buttons */

.devbook-btn-primary {
    min-height: 52px;
    padding: 12px 24px;
    border: 1px solid rgba(129, 140, 248, 0.55);
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-light), var(--accent-dark));
    color: #fff;
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.25);
}

.devbook-btn-primary:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 18px 40px rgba(99, 102, 241, 0.35);
}

.devbook-btn-secondary {
    color: var(--accent-light);
    border: 1px solid var(--border-strong);
    background: rgba(15, 23, 42, 0.55);
    border-radius: 10px;
    padding: 12px 18px;
    font-weight: 600;
}

.devbook-btn-secondary:hover {
    color: #fff;
    background: rgba(99, 102, 241, 0.16);
    border-color: var(--accent-light);
}

.devbook-btn-secondary:disabled {
    color: #64748b;
    border-color: rgba(100, 116, 139, 0.25);
}

/* Checkboxes */

.search-fields {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 12px;
    color: var(--text-soft);
    font-weight: 700;
}

.search-fields span {
    width: 100%;
    margin-bottom: 4px;
}

.search-fields label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.search-fields input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

/* Table */

.result-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
    color: var(--text-soft);
    font-weight: 700;
    font-size: 0.95rem;
}

.devbook-table-wrapper {
    position: relative;
    min-height: 420px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(13, 21, 38, 0.55);
}

.devbook-table {
    margin: 0;
    color: var(--text-main);
}

.devbook-table thead th {
    background: rgba(5, 11, 24, 0.9);
    color: var(--text-main);
    border-bottom: 1px solid var(--border-soft);
    padding: 18px 20px;
    font-weight: 800;
}

.devbook-table tbody td {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    color: var(--text-soft);
    vertical-align: middle;
}

.devbook-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.08);
}

.command-cell {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 8px;
    padding: 6px 10px;
    display: inline-block;
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.label-pill {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.16);
    color: var(--accent-light);
    font-weight: 700;
}

.edit-link {
    color: var(--accent-light);
    text-decoration: none;
    font-weight: 700;
}

.edit-link:hover {
    color: #fff;
    text-decoration: underline;
}

/* Empty state */

.empty-state {
    position: absolute;
    inset: 64px 0 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
}

.empty-icon {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    background:
        radial-gradient(circle at top, rgba(129, 140, 248, 0.35), rgba(49, 46, 129, 0.25));
}

.empty-icon i {
    font-size: 4rem;
    color: var(--text-main);
}

.empty-state h3 {
    color: var(--text-main);
    font-weight: 800;
    margin-bottom: 8px;
}

.empty-state p {
    margin: 0;
}

/* Footer results */

.results-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    padding-top: 24px;
}

.pagination-actions {
    display: flex;
    gap: 10px;
}

/* Global footer */

.devbook-footer {
    border-top: 1px solid var(--border-soft);
    background: rgba(5, 11, 24, 0.82);
    color: var(--text-muted);
    padding: 24px;
    text-align: center;
}

.devbook-footer i {
    color: var(--accent-light);
    margin-right: 8px;
}

/* Responsive */

@media (max-width: 768px) {
    .devbook-container {
        padding: 0 18px;
    }

    .devbook-header .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 18px;
    }

    .devbook-card {
        padding: 22px;
    }

    .search-fields {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-fields .ms-auto {
        margin-left: 0 !important;
        width: 100%;
    }

    .results-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .pagination-actions {
        width: 100%;
    }

    .pagination-actions .btn {
        flex: 1;
    }
}


.page-header {
    margin-bottom: 24px;
}

.eyebrow {
    color: #64ffda;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-header h2 {
    color: #e6f1ff;
    font-size: 2rem;
    margin: 0 0 8px;
}

.page-subtitle {
    color: #8892b0;
    margin: 0;
    max-width: 720px;
}

.form-card {
    background: #112240;
    border: 1px solid #233554;
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 18px 40px rgba(2, 12, 27, 0.35);
}

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

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #ccd6f6;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: #0a192f;
    border: 1px solid #233554;
    border-radius: 6px;
    color: #e6f1ff;
    padding: 12px 14px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #64748b;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #64ffda;
    box-shadow: 0 0 0 3px rgba(100, 255, 218, 0.12);
}

.form-group textarea {
    resize: vertical;
    min-height: 160px;
    line-height: 1.5;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}

.btn-primary,
.btn-secondary {
    border-radius: 6px;
    padding: 11px 18px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
    background: #64ffda;
    border: 1px solid #64ffda;
    color: #0a192f;
}

.btn-secondary {
    background: transparent;
    border: 1px solid #233554;
    color: #ccd6f6;
}

.btn-primary:hover,
.btn-secondary:hover {
    transform: translateY(-1px);
}

.btn-primary:hover {
    background: #8affea;
}

.btn-secondary:hover {
    border-color: #64ffda;
    color: #64ffda;
}

@media (max-width: 768px) {
    .form-card {
        padding: 20px;
    }

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

    .form-actions {
        flex-direction: column-reverse;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        text-align: center;
    }
}

/* Table results */
.devbook-table {
    --bs-table-bg: transparent;
    --bs-table-color: b8c0d8;
    margin-bottom: 0;
}

.devbook-table tbody tr {
    background: #101827;
    border-bottom: 1px solid rgba(132, 146, 255, 0.16);
}

.devbook-table tbody tr:nth-child(even) {
    background: #0c1424;
}

.devbook-table tbody td {
    background: transparent !important;
    color: #dbe4ff;
    border-color: rgba(132, 146, 255, 0.14);
    vertical-align: middle;
}

.devbook-table tbody td code {
    color: #ff4fa3;
    background: rgba(255, 79, 163, 0.1);
    border: 1px solid rgba(255, 79, 163, 0.18);
    border-radius: 6px;
    padding: 4px 7px;
}

/* Action buttons in table */
.devbook-action-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    color: #ffffff;
    background: rgba(118, 126, 255, 0.22);
    border: 1px solid rgba(132, 146, 255, 0.55);
}

.devbook-action-btn.delete {
    color: #ff8fa3;
    border-color: rgba(255, 79, 123, 0.45);
    background: rgba(255, 79, 123, 0.12);
}
.devbook-action-btn:hover {
    color: #ffffff;
    background: #767eff;
    border-color: #8f96ff;
    transform: translateY(-1px);
}

.devbook-action-btn.delete:hover {
     color: #ffffff;
    background: #ff4f7b;
    border-color: #ff7a9b;
    box-shadow: 0 0 18px rgba(255, 79, 123, 0.35);
}

.brand-icon {
    width: 34px;
    height: 34px;
    /*color: #8b90ff;*/
    stroke-width: 2;
}

.devbook-editor {
    min-height: 240px;
    background: #0b1220;
    border-radius: 0 0 14px 14px;
    color: b8c0d8;
}

.ql-toolbar.ql-snow {
    background: #101827;
    border: 1px solid rgba(132, 146, 255, 0.35);
    border-radius: 14px 14px 0 0;
}

.ql-container.ql-snow {
    border: 1px solid rgba(132, 146, 255, 0.35);
    border-top: 0;
    border-radius: 0 0 14px 14px;
    color: b8c0d8;
    font-size: 1rem;
}

.ql-editor {
    min-height: 240px;
}

.ql-editor.ql-blank::before {
    color: #7d89aa;
}

.ql-snow .ql-stroke {
    stroke: #cdd6f6;
}

.ql-snow .ql-fill {
    fill: #cdd6f6;
}

.ql-snow .ql-picker {
    color: #cdd6f6;
}

.devbook-description-preview {
    color: b8c0d8;
    line-height: 1.55;
    max-width: 440px;
}

.devbook-description-preview p {
    margin-bottom: 0.5rem;
}

.devbook-description-preview img {
    max-width: 180px;
    max-height: 120px;
    border-radius: 10px;
    display: block;
    margin-top: 8px;
    border: 1px solid rgba(132, 146, 255, 0.25);
}

.devbook-description-preview ul,
.devbook-description-preview ol {
    padding-left: 1.2rem;
    margin-bottom: 0.5rem;
}

.devbook-description-preview pre {
    background: rgba(5, 10, 22, 0.75);
    border: 1px solid rgba(132, 146, 255, 0.18);
    border-radius: 8px;
    padding: 8px;
    color: #ff4fa3;
    white-space: pre-wrap;
}


.td-label,
.td-title,
.td-command {
  width: 120px;
  white-space: nowrap;
}

.td-description {
  width: 35%;
}

.devbook-description-preview .ql-code-block,
.ql-editor .ql-code-block {
    background: rgba(5, 10, 22, 0.85);
    border: 1px solid rgba(132, 146, 255, 0.22);
    border-radius: 8px;
    color: #ff4fa3;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    padding: 8px 10px;
    white-space: pre-wrap;
    margin: 6px 0;
}


/* modal */
.description-preview {
    color: #dbe4ff;
    line-height: 1.45;
    max-width: 520px;
}

.description-preview .read-more-hint {
    display: block;
    margin-top: 6px;
    color: #8b90ff;
    font-size: 0.85rem;
}

.devbook-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(8px);
}

.devbook-modal-backdrop.is-open {
    display: flex;
}

.devbook-modal {
    width: min(980px, 100%);
    max-height: 86vh;
    background: #101827;
    border: 1px solid rgba(132, 146, 255, 0.35);
    border-radius: 18px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.devbook-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 32px 18px;
    border-bottom: 1px solid rgba(132, 146, 255, 0.18);
}

.devbook-modal-header h2 {
    margin: 0;
    color: #f4f7ff;
    font-size: 1.8rem;
}

.modal-label {
    display: inline-block;
    margin-bottom: 8px;
    color: #8b90ff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
}

.modal-close {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(132, 146, 255, 0.35);
    border-radius: 10px;
    background: rgba(132, 146, 255, 0.1);
    color: #e6ecff;
}

.modal-close:hover {
    background: #767eff;
}

.devbook-modal-meta {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 32px;
    border-bottom: 1px solid rgba(132, 146, 255, 0.12);
    color: #aeb9d6;
}

.devbook-modal-meta code {
    color: #ff4fa3;
    background: rgba(255, 79, 163, 0.1);
    border: 1px solid rgba(255, 79, 163, 0.18);
    border-radius: 8px;
    padding: 4px 8px;
    white-space: pre-wrap;
}

.devbook-modal-content {
    max-height: 58vh;
    overflow-y: auto;
    padding: 28px 32px 34px;
    color: #e6ecff;
    line-height: 1.7;
}

.devbook-modal-content img {
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(132, 146, 255, 0.25);
    margin: 14px 0;
}

.devbook-modal-content pre {
    background: #070d1a;
    border: 1px solid rgba(132, 146, 255, 0.18);
    border-radius: 10px;
    padding: 14px;
    color: #ff4fa3;
    white-space: pre-wrap;
}

@media (max-width: 768px) {
    .devbook-modal-backdrop {
        padding: 16px;
    }

    .devbook-modal-header,
    .devbook-modal-meta,
    .devbook-modal-content {
        padding-left: 20px;
        padding-right: 20px;
    }

    .devbook-modal-meta {
        flex-direction: column;
    }
}

.devbook-modal-content code,
.devbook-modal-content .ql-code-block {
    display: block;
    background: #1e1e1e;
    color: #ff4fa3;
    border: 1px solid rgba(255, 79, 163, 0.18);
    padding: 4px 8px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    overflow-x: auto;
    margin: 8px 0;
}

.devbook-modal-content p {
    margin-top: 0;
    margin-bottom: 0rem;
}

.devbook-tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #cdd6ff;
    background: rgba(118, 126, 255, 0.16);
    border: 1px solid rgba(118, 126, 255, 0.35);
}

.devbook-private-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #ff8fa3;
    background: rgba(255, 79, 123, 0.12);
    border: 1px solid rgba(255, 79, 123, 0.35);
}