/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #dbeafe;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --text: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --purple: #8b5cf6;
    --purple-light: #ede9fe;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-lg: 0 4px 12px rgba(0,0,0,.1);
    --sidebar-width: 240px;
    --right-panel-width: 300px;
    --transition: .2s ease;
}

html { font-size: 14px; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    overflow: hidden;
}
body.landing-active { overflow: auto; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

.hidden { display: none !important; }
.view { display: none; height: 100vh; }
.view.active { display: flex; }
#landing-view { height: auto; overflow-y: auto; }
#landing-view.active { display: block; }


/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border: none; border-radius: var(--radius);
    font-family: inherit; font-size: .875rem; font-weight: 500;
    cursor: pointer; transition: all var(--transition);
    white-space: nowrap;
}
.btn:active { transform: scale(.97); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-text { background: none; color: var(--text-secondary); padding: 6px 10px; }
.btn-text:hover { color: var(--text); background: var(--border-light); }

.btn-full { width: 100%; justify-content: center; padding: 10px; }
.btn-sm { font-size: .8rem; padding: 4px 10px; }
.btn-icon-only { padding: 8px; }

.btn-icon {
    background: none; border: none; cursor: pointer;
    padding: 4px 6px; border-radius: 4px; font-size: 1rem;
    transition: background var(--transition);
}
.btn-icon:hover { background: var(--border-light); }


/* ===== FORMS ===== */
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block; font-size: .85rem; font-weight: 600;
    color: var(--text); margin-bottom: 4px;
}

.form-input, select.form-input, textarea.form-input {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border);
    border-radius: var(--radius); font-family: inherit; font-size: .875rem;
    background: var(--surface); color: var(--text);
    transition: border var(--transition), box-shadow var(--transition);
}
.form-input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

textarea.form-input { resize: vertical; min-height: 60px; }

.checkbox-group {
    max-height: 180px; overflow-y: auto; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 8px;
}
.checkbox-label {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 6px; border-radius: 4px; cursor: pointer;
    font-size: .85rem;
}
.checkbox-label:hover { background: var(--border-light); }
.checkbox-label input[type="checkbox"] { accent-color: var(--primary); }


/* ===== LANDING ===== */
.landing { font-size: 16px; line-height: 1.6; width: 100%; }

/* Nav */
.lnd-nav {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.lnd-nav-inner {
    max-width: 1120px; margin: 0 auto; padding: 14px 24px;
    display: flex; align-items: center; gap: 24px;
}
.lnd-logo { font-size: 18px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 6px; }
.lnd-nav-links { display: flex; gap: 20px; margin-left: auto; }
.lnd-nav-links a { font-size: 14px; font-weight: 500; color: var(--text-secondary); transition: color .15s; }
.lnd-nav-links a:hover { color: var(--primary); }

/* Hero */
.lnd-hero {
    max-width: 1120px; margin: 0 auto; padding: 64px 24px 48px;
    display: flex; align-items: center; gap: 48px;
}
.lnd-hero-content { flex: 1; }
.lnd-hero-title {
    font-size: 2.25rem; font-weight: 800; line-height: 1.2;
    color: var(--text); margin-bottom: 20px;
}
.lnd-hero-sub { font-size: 1.05rem; color: var(--text-secondary); margin-bottom: 28px; max-width: 520px; }
.lnd-hero-cta {
    padding: 14px 32px; font-size: 1rem; font-weight: 600;
    border-radius: 10px; cursor: pointer;
}
.lnd-hero-img { flex: 0 0 44%; }
.lnd-hero-img img {
    width: 100%; border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,.12);
    object-fit: cover; aspect-ratio: 4/3;
}

/* Sections */
.lnd-section { max-width: 1120px; margin: 0 auto; padding: 64px 24px; }
.lnd-section-alt {
    background: var(--bg); max-width: none; padding: 64px 24px;
}
.lnd-section-alt > * { max-width: 1120px; margin-left: auto; margin-right: auto; }
.lnd-section-title {
    font-size: 1.75rem; font-weight: 700; text-align: center;
    margin-bottom: 40px; color: var(--text);
}

/* For whom cards */
.lnd-cards { display: grid; gap: 20px; }
.lnd-cards-4 { grid-template-columns: repeat(4, 1fr); }
.lnd-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 28px 20px; text-align: center;
    transition: box-shadow .2s, transform .2s;
}
.lnd-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.lnd-card-icon { margin-bottom: 14px; }
.lnd-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.lnd-card p { font-size: 13px; color: var(--text-secondary); }

/* Problems */
.lnd-problems-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.lnd-problem {
    display: flex; gap: 16px; align-items: flex-start;
    background: var(--surface); border-radius: 12px; padding: 24px;
    border: 1px solid var(--border);
}
.lnd-problem-num {
    flex-shrink: 0; width: 36px; height: 36px;
    background: var(--primary); color: #fff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px;
}
.lnd-problem h4 { font-size: 15px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.lnd-problem p { font-size: 13px; color: var(--text-secondary); }

/* Feature cards – tall, in a row, interactive */
.lnd-feat-grid {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px;
}
.lnd-feat-card {
    position: relative; background: var(--surface);
    border: 1px solid var(--border); border-radius: 14px;
    padding: 28px 20px 24px; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    cursor: default; transition: transform .25s, box-shadow .25s, border-color .25s;
    overflow: hidden;
}
.lnd-feat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: attr(data-color); border-radius: 14px 14px 0 0;
    transition: height .3s;
}
.lnd-feat-card[data-color="#3b82f6"]::before { background: #3b82f6; }
.lnd-feat-card[data-color="#8b5cf6"]::before { background: #8b5cf6; }
.lnd-feat-card[data-color="#10b981"]::before { background: #10b981; }
.lnd-feat-card[data-color="#f59e0b"]::before { background: #f59e0b; }
.lnd-feat-card[data-color="#ef4444"]::before { background: #ef4444; }
.lnd-feat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0,0,0,.1);
}
.lnd-feat-card:hover::before { height: 6px; }

.lnd-feat-ico {
    width: 56px; height: 56px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    transition: transform .3s;
}
.lnd-feat-card[data-color="#3b82f6"] .lnd-feat-ico { background: #dbeafe; color: #3b82f6; }
.lnd-feat-card[data-color="#8b5cf6"] .lnd-feat-ico { background: #ede9fe; color: #8b5cf6; }
.lnd-feat-card[data-color="#10b981"] .lnd-feat-ico { background: #d1fae5; color: #10b981; }
.lnd-feat-card[data-color="#f59e0b"] .lnd-feat-ico { background: #fef3c7; color: #f59e0b; }
.lnd-feat-card[data-color="#ef4444"] .lnd-feat-ico { background: #fee2e2; color: #ef4444; }
.lnd-feat-card:hover .lnd-feat-ico { transform: scale(1.1) rotate(-3deg); }
.lnd-feat-card h4 { font-size: 15px; font-weight: 600; color: var(--text); margin: 0; }
.lnd-feat-card p { font-size: 13px; color: var(--text-secondary); margin: 0; line-height: 1.5; }

/* Cases */
.lnd-cases-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.lnd-case {
    background: var(--surface); border-radius: 12px; overflow: hidden;
    border: 1px solid var(--border); transition: box-shadow .2s;
}
.lnd-case:hover { box-shadow: var(--shadow-lg); }
.lnd-case-img img { width: 100%; height: 200px; object-fit: cover; }
.lnd-case-body { padding: 20px; }
.lnd-case-quote {
    font-size: 14px; font-style: italic; color: var(--text);
    margin-bottom: 14px; line-height: 1.5;
}
.lnd-case-author strong { display: block; font-size: 14px; color: var(--text); }
.lnd-case-author span { font-size: 12px; color: var(--text-secondary); }

/* CTA section */
.lnd-cta-section {
    text-align: center; padding: 64px 24px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
}
.lnd-cta-section h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.lnd-cta-section p { font-size: 1rem; color: var(--text-secondary); margin-bottom: 24px; }

/* Footer */
.lnd-footer {
    text-align: center; padding: 20px; font-size: 13px;
    color: var(--text-muted); border-top: 1px solid var(--border);
}

/* Landing responsive */
@media (max-width: 900px) {
    .lnd-hero { flex-direction: column; padding-top: 40px; }
    .lnd-hero-img { flex: none; width: 100%; }
    .lnd-hero-title { font-size: 1.6rem; }
    .lnd-cards-4 { grid-template-columns: repeat(2, 1fr); }
    .lnd-problems-grid { grid-template-columns: 1fr; }
    .lnd-cases-grid { grid-template-columns: 1fr; }
    .lnd-feat-grid { grid-template-columns: repeat(2, 1fr); }
    .lnd-nav-links { display: none; }
}


/* ===== AUTH ===== */
.auth-container {
    width: 100%; height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 100%);
}

.auth-card {
    background: var(--surface); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); padding: 40px; width: 420px; max-width: 95vw;
}

.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-back-link {
    display: inline-block; font-size: 13px; color: var(--text-secondary);
    margin-bottom: 16px; transition: color .15s;
}
.auth-back-link:hover { color: var(--primary); }
.logo-icon { font-size: 2.5rem; margin-bottom: 8px; }
.auth-logo h1 { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.auth-subtitle { color: var(--text-secondary); font-size: .9rem; margin-top: 4px; }

.auth-tabs { display: flex; gap: 0; margin-bottom: 24px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.auth-tab {
    flex: 1; padding: 9px; border: none; background: var(--bg);
    font-family: inherit; font-size: .875rem; font-weight: 500;
    cursor: pointer; color: var(--text-secondary); transition: all var(--transition);
}
.auth-tab.active { background: var(--primary); color: #fff; }
.auth-tab:hover:not(.active) { background: var(--border); }


/* ===== PROJECTS ===== */
#projects-view { flex-direction: column; }
.projects-container { padding: 40px; max-width: 1000px; margin: 0 auto; width: 100%; overflow-y: auto; }
.projects-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 32px; }
.projects-header h1 { font-size: 1.75rem; font-weight: 700; }
.subtitle { color: var(--text-secondary); margin-top: 4px; }

.projects-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.project-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
    cursor: pointer; transition: all var(--transition);
    position: relative; display: flex; flex-direction: column;
}
.project-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }

.project-card-img { height: 120px; overflow: hidden; background: var(--bg); }
.project-card-img img { width: 100%; height: 100%; object-fit: cover; }
.project-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }

.project-card-add {
    border: 2px dashed var(--border); display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 8px;
    color: var(--text-secondary); min-height: 140px;
}
.project-card-add:hover { border-color: var(--primary); color: var(--primary); }
.add-icon { font-size: 2rem; line-height: 1; }

.project-card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.project-card-title { font-size: 1.1rem; font-weight: 600; }
.project-card-desc {
    color: var(--text-secondary); font-size: .82rem; margin-top: 8px;
    line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.project-card-date { color: var(--text-muted); font-size: .8rem; margin-top: auto; padding-top: 12px; }

.project-card-actions { display: flex; gap: 2px; opacity: 0; transition: opacity var(--transition); }
.project-card:hover .project-card-actions { opacity: 1; }
.project-edit, .project-delete {
    background: none; border: none; font-size: 1rem; cursor: pointer;
    color: var(--text-muted); padding: 2px 6px; border-radius: 4px;
    transition: background var(--transition), color var(--transition);
}
.project-edit:hover { background: var(--primary-light); color: var(--primary); }
.project-delete:hover { background: var(--danger-light); color: var(--danger); }

/* Image upload in modal */
.image-upload-area { display: flex; flex-direction: column; gap: 8px; }
.image-preview { position: relative; border-radius: var(--radius); overflow: hidden; max-height: 140px; }
.image-preview img { width: 100%; max-height: 140px; object-fit: cover; border-radius: var(--radius); }
.image-remove {
    position: absolute; top: 6px; right: 6px;
    background: rgba(0,0,0,.6); color: white; border: none;
    padding: 3px 8px; border-radius: 4px; font-size: 11px;
    cursor: pointer; transition: background .15s;
}
.image-remove:hover { background: var(--danger); }
.form-hint { color: var(--text-muted); font-size: 11px; }


/* ===== APP LAYOUT ===== */
.app-layout {
    display: flex; width: 100%; height: 100vh; overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width); min-width: var(--sidebar-width);
    background: var(--surface); border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
}

.sidebar-header { padding: 16px 16px 12px; border-bottom: 1px solid var(--border); }

.btn-back {
    display: inline-flex; align-items: center; gap: 4px;
    background: none; border: none; color: var(--text-secondary);
    font-family: inherit; font-size: .8rem; cursor: pointer;
    padding: 4px 0; margin-bottom: 8px;
}
.btn-back:hover { color: var(--primary); }
.btn-back svg { flex-shrink: 0; }

.project-title {
    font-size: 1.1rem; font-weight: 700; line-height: 1.3;
    word-break: break-word;
}

.sidebar-nav { flex: 1; padding: 8px; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius);
    color: var(--text-secondary); font-size: .9rem; font-weight: 500;
    transition: all var(--transition); margin-bottom: 2px;
}
.nav-item:hover { background: var(--border-light); color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary-dark); }
.nav-item svg { flex-shrink: 0; }

/* Workspace */
.workspace {
    flex: 1; padding: 24px 32px; overflow-y: auto; background: var(--bg);
    display: flex; flex-direction: column;
}

.section-header {
    display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
    flex-wrap: wrap; flex-shrink: 0;
}
.section-header h2 { font-size: 1.4rem; font-weight: 700; flex: 1; }

.btn-back-sm {
    background: none; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 6px 12px; font-family: inherit; font-size: .8rem;
    cursor: pointer; color: var(--text-secondary);
}
.btn-back-sm:hover { background: var(--surface); color: var(--text); }

.loading {
    display: flex; align-items: center; justify-content: center;
    height: 200px; color: var(--text-muted); font-size: 1rem;
}

/* Right panel */
.right-panel {
    width: var(--right-panel-width); min-width: var(--right-panel-width);
    background: var(--surface); border-left: 1px solid var(--border);
    display: flex; flex-direction: column;
}

.chat-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.chat-header {
    display: flex; align-items: center; gap: 8px;
    padding: 14px 16px; border-bottom: 1px solid var(--border);
    font-weight: 600; font-size: .9rem;
}
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; }
.chat-message { margin-bottom: 12px; }
.chat-message.bot p {
    background: var(--border-light); padding: 10px 14px;
    border-radius: 12px 12px 12px 2px; font-size: .85rem;
    color: var(--text-secondary); line-height: 1.5;
}

.chat-input-area {
    display: flex; gap: 8px; padding: 12px 16px;
    border-top: 1px solid var(--border);
}
.chat-input-area .form-input { flex: 1; padding: 8px 12px; }

.profile-panel {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-top: 1px solid var(--border);
    background: var(--border-light); gap: 8px;
}
.profile-info { display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; }
.profile-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: .85rem; flex-shrink: 0;
}
.profile-email {
    font-size: .8rem; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}


/* ===== TABLES ===== */
.table-container {
    background: var(--surface); border-radius: var(--radius-lg);
    border: 1px solid var(--border); overflow: hidden;
    flex-shrink: 0;
}

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left; padding: 10px 16px;
    background: var(--border-light); color: var(--text-secondary);
    font-size: .75rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .05em; border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 10px 16px; border-bottom: 1px solid var(--border-light);
    font-size: .875rem; vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafbfc; }
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: var(--primary-light) !important; }


/* ===== BADGES ===== */
.badge {
    display: inline-block; padding: 2px 8px; border-radius: 20px;
    font-size: .75rem; font-weight: 500; background: var(--primary-light);
    color: var(--primary-dark); margin: 1px 2px;
}
.badge-sm { padding: 1px 6px; font-size: .7rem; }
.badges { display: flex; flex-wrap: wrap; gap: 2px; }

.status-badge {
    display: inline-flex; align-items: center; padding: 3px 10px;
    border-radius: 20px; font-size: .7rem; font-weight: 600;
    cursor: pointer; transition: all var(--transition);
    text-transform: uppercase; letter-spacing: .03em;
}
.status-badge:hover { filter: brightness(0.95); transform: scale(1.05); }

.status-draft { background: #f1f5f9; color: #64748b; }
.status-ai { background: var(--purple-light); color: var(--purple); }
.status-in_progress { background: var(--primary-light); color: var(--primary-dark); }
.status-review { background: var(--warning-light); color: #b45309; }
.status-done { background: var(--success-light); color: #065f46; }

.responsible-badge {
    display: inline-flex; align-items: center; padding: 3px 10px;
    border-radius: 20px; font-size: .75rem; cursor: pointer;
    background: var(--border-light); color: var(--text-secondary);
    border: 1px dashed var(--border); transition: all var(--transition);
}
.responsible-badge:hover { border-color: var(--primary); color: var(--primary); }

.schedule-badge {
    display: inline-flex; align-items: center; padding: 2px 8px;
    border-radius: 20px; font-size: .7rem; font-weight: 500;
    background: var(--warning-light); color: #92400e;
}

.executor-badges { display: inline-flex; flex-wrap: wrap; gap: 2px; }

/* ===== SCHEDULE RULE BUILDER ===== */
.sch-fieldset {
    border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 16px; margin-top: 8px;
}
.sch-fieldset legend {
    font-size: .85rem; font-weight: 600; color: var(--text); padding: 0 6px;
}
.sch-legend-toggle {
    cursor: pointer; user-select: none;
}
.sch-legend-toggle:hover { color: var(--primary); }
.sch-toggle-arrow {
    display: inline-block; font-size: .7rem; margin-right: 2px;
    transition: transform .2s;
}
.sch-row {
    display: flex; align-items: center; gap: 10px; margin-top: 10px;
}
.sch-row label { min-width: 110px; font-size: .82rem; color: var(--text-secondary); flex-shrink: 0; }
.sch-inline { display: flex; align-items: center; gap: 6px; }
.sch-inline span { font-size: .82rem; color: var(--text-secondary); }
.sch-num { width: 70px !important; }
.form-input-sm { height: 34px; font-size: .85rem; }
.sch-weekdays { display: flex; gap: 4px; flex-wrap: wrap; }
.sch-weekday-btn {
    width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--border);
    background: var(--surface); color: var(--text); font-size: .78rem; font-weight: 600;
    cursor: pointer; transition: all .15s;
    display: flex; align-items: center; justify-content: center;
}
.sch-weekday-btn:hover { border-color: var(--primary); color: var(--primary); }
.sch-weekday-btn.active {
    background: var(--primary); color: #fff; border-color: var(--primary);
}

/* ===== PROCESS TREE ===== */
.process-tree {
    background: var(--surface); border-radius: var(--radius-lg);
    border: 1px solid var(--border); overflow: hidden;
    flex-shrink: 0;
}

.tree-row {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px; border-bottom: 1px solid var(--border-light);
    transition: background var(--transition); min-height: 42px;
    position: relative;
}
.tree-row:hover { background: #fafbfc; }
.tree-row:hover .tree-actions { opacity: 1; }

/* Level styling */
.tree-row-group {
    padding-left: 12px; background: var(--border-light);
    border-left: 3px solid var(--primary);
}
.tree-row-process { padding-left: 36px; }
.tree-row-operation { padding-left: 64px; }
.tree-row-task { padding-left: 92px; }

.tree-toggle {
    cursor: pointer; user-select: none; width: 18px; text-align: center;
    font-size: .7rem; color: var(--text-muted); flex-shrink: 0;
    transition: color var(--transition);
}
.tree-toggle:hover { color: var(--text); }

.tree-dot { color: var(--text-muted); font-size: .6rem; width: 18px; text-align: center; flex-shrink: 0; }

.tree-task-expand {
    width: 18px; text-align: center; flex-shrink: 0;
    cursor: pointer; font-size: .65rem; color: var(--primary);
    user-select: none; transition: color .15s;
}
.tree-task-expand:hover { color: var(--text); }
.tree-task-expand.expanded { color: var(--primary); }

.tree-task-desc {
    margin: 0 16px 4px 0; padding: 8px 12px 8px 140px;
    font-size: .82rem; line-height: 1.5;
    color: var(--text-secondary); background: var(--bg);
    border-radius: var(--radius); border-left: 3px solid var(--primary-light);
    margin-left: 0;
}
.tree-task-desc p { margin: 0 0 4px; }
.tree-task-desc ul, .tree-task-desc ol { margin: 0 0 4px; padding-left: 1.2em; }

.tree-name {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; outline: none; border-radius: 3px;
    padding: 2px 4px;
}
.tree-name.editing {
    background: #fff; box-shadow: 0 0 0 2px var(--primary-light);
    white-space: normal; overflow: visible;
}

.tree-name-group { font-weight: 700; font-size: .95rem; color: var(--text); }
.tree-name-process { font-weight: 600; font-size: .9rem; }
.tree-name-operation { font-weight: 500; font-size: .85rem; color: var(--text-secondary); }
.tree-name-task { font-weight: 400; font-size: .85rem; }

.tree-actions {
    display: flex; gap: 4px; opacity: 0; transition: opacity var(--transition);
    flex-shrink: 0;
}
.btn-tree-action {
    background: none; border: 1px solid transparent; border-radius: var(--radius);
    padding: 3px 8px; font-family: inherit; font-size: .75rem;
    cursor: pointer; color: var(--primary); white-space: nowrap;
    transition: all var(--transition);
}
.btn-tree-action:hover { background: var(--primary-light); border-color: var(--primary-light); }
.btn-danger-text { color: var(--danger); }
.btn-danger-text:hover { background: var(--danger-light); border-color: var(--danger-light); }

.tree-children { /* container for nested items */ }

.drag-handle {
    cursor: grab; color: var(--text-muted); font-size: .9rem;
    opacity: 0; transition: opacity var(--transition);
    user-select: none; flex-shrink: 0;
}
.tree-row:hover .drag-handle { opacity: 1; }
.drag-handle:active { cursor: grabbing; }

/* Sortable ghost */
.sortable-ghost { opacity: .4; background: var(--primary-light) !important; }
.sortable-chosen { box-shadow: var(--shadow-lg); }


/* ===== TOGGLE SWITCH ===== */
.toggle-label {
    display: inline-flex; align-items: center; gap: 4px;
    cursor: pointer; flex-shrink: 0;
}
.toggle-input { display: none; }
.toggle-slider {
    width: 32px; height: 18px; background: var(--border);
    border-radius: 9px; position: relative; transition: background var(--transition);
}
.toggle-slider::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 14px; height: 14px; background: #fff; border-radius: 50%;
    transition: transform var(--transition); box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.toggle-input:checked + .toggle-slider { background: var(--success); }
.toggle-input:checked + .toggle-slider::after { transform: translateX(14px); }
.toggle-text { font-size: .8rem; }


/* ===== CONFIRM DIALOG ===== */
.confirm-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,.4);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000; backdrop-filter: blur(2px);
    opacity: 0; transition: opacity .15s ease;
}
.confirm-overlay.active { opacity: 1; }
.confirm-dialog {
    background: var(--surface); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); width: 400px; max-width: 90vw;
    animation: modalIn .2s ease;
}
.confirm-body {
    padding: 24px 24px 16px; font-size: .95rem; line-height: 1.5;
    color: var(--text);
}
.confirm-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 12px 24px 20px;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,.4);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; backdrop-filter: blur(2px);
}

.modal {
    background: var(--surface); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); width: 720px; max-width: 95vw;
    max-height: 90vh; display: flex; flex-direction: column;
    animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.95) translateY(10px); } }

.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.1rem; font-weight: 600; }
.modal-close {
    background: none; border: none; font-size: 1.4rem; cursor: pointer;
    color: var(--text-muted); padding: 2px 6px; border-radius: 4px;
    line-height: 1;
}
.modal-close:hover { background: var(--border-light); color: var(--text); }

.modal-body { padding: 20px; overflow-y: auto; flex: 1; }

.modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 12px 20px; border-top: 1px solid var(--border);
}

/* Rich editor */
.rich-editor {
    border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius);
    padding: 10px 12px; min-height: 150px; max-height: 300px; overflow-y: auto;
    font-family: inherit; font-size: .875rem; line-height: 1.6; outline: none;
    transition: border var(--transition), box-shadow var(--transition);
}
.rich-editor:empty::before {
    content: attr(data-placeholder); color: var(--text-secondary); pointer-events: none;
}
.rich-editor:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.rich-editor ul, .rich-editor ol { padding-left: 20px; }
.rich-editor p { margin-bottom: 6px; }

/* Rich text toolbar */
.rt-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
    padding: 4px 6px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
}
.rt-toolbar button {
    background: none; border: 1px solid transparent; border-radius: 3px;
    cursor: pointer; padding: 2px 6px; font-size: 13px; line-height: 1.4;
    color: var(--text); min-width: 26px; text-align: center;
}
.rt-toolbar button:hover { background: var(--border); }
.rt-toolbar select {
    border: 1px solid var(--border); border-radius: 3px; padding: 2px 4px;
    font-size: 12px; background: var(--bg); color: var(--text); cursor: pointer;
}
.rt-toolbar input[type="color"] {
    width: 26px; height: 24px; border: 1px solid var(--border);
    border-radius: 3px; padding: 1px; cursor: pointer; background: none;
}
.rt-sep {
    width: 1px; height: 18px; background: var(--border); margin: 0 4px;
}


/* ===== TOAST ===== */
.toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: var(--text); color: #fff; padding: 10px 24px;
    border-radius: var(--radius); font-size: .875rem; z-index: 2000;
    box-shadow: var(--shadow-lg); animation: toastIn .3s ease;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }
.toast-clickable { cursor: pointer; text-decoration: underline; }
.toast-clickable:hover { filter: brightness(1.1); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } }

/* ===== TREE TASK HIGHLIGHT ===== */
.tree-task-highlight {
    animation: taskHighlight 2s ease;
}
@keyframes taskHighlight {
    0%   { background: rgba(59,130,246,.25); }
    50%  { background: rgba(59,130,246,.10); }
    100% { background: transparent; }
}


/* ===== EMPTY STATE ===== */
.empty-state {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state-text { font-size: .95rem; }


/* ===== VIEW TOGGLE ===== */
.section-header { display: flex; align-items: center; gap: 12px; }
.section-header h2 { margin-right: auto; }
.view-toggle { display: flex; background: var(--bg); border-radius: var(--radius); padding: 3px; gap: 2px; }
.view-toggle-btn {
    display: flex; align-items: center; gap: 5px;
    padding: 5px 12px; border: none; background: none;
    border-radius: 6px; cursor: pointer; font-size: 13px;
    color: var(--text-secondary); transition: var(--transition);
}
.view-toggle-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.view-toggle-btn:hover:not(.active) { color: var(--text); }

/* ===== DASHBOARD ===== */
.dash-cards {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px; margin-bottom: 28px;
}
.dash-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px;
    display: flex; align-items: center; gap: 16px;
    transition: all var(--transition);
}
.dash-card[data-section] { cursor: pointer; }
.dash-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.dash-card-icon {
    width: 48px; height: 48px; border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.dash-icon-blue   { background: var(--primary-light); color: var(--primary); }
.dash-icon-indigo  { background: var(--purple-light); color: var(--purple); }
.dash-icon-green  { background: var(--success-light); color: var(--success); }
.dash-icon-purple { background: #f3e8ff; color: #9333ea; }
.dash-icon-amber  { background: var(--warning-light); color: var(--warning); }
.dash-icon-teal   { background: #ccfbf1; color: #0d9488; }
.dash-card-label { font-size: .82rem; color: var(--text-secondary); margin-bottom: 2px; }
.dash-card-value { font-size: 1.6rem; font-weight: 700; color: var(--text); line-height: 1; }

.dash-section { margin-bottom: 28px; }
.dash-section-title {
    font-size: 1rem; font-weight: 600; margin-bottom: 14px;
    color: var(--text);
}
.dash-statuses {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px;
    display: flex; flex-direction: column; gap: 10px;
}
.dash-status-row {
    display: flex; align-items: center; gap: 10px; font-size: .85rem;
}
.dash-status-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.dash-status-label { min-width: 100px; color: var(--text-secondary); }
.dash-status-bar {
    flex: 1; height: 8px; background: var(--bg);
    border-radius: 4px; overflow: hidden;
}
.dash-status-fill { height: 100%; border-radius: 4px; transition: width .4s ease; }
.dash-status-count { font-weight: 600; min-width: 24px; text-align: right; }

/* ===== KANBAN BOARD ===== */
.kanban-board {
    display: flex; gap: 16px;
    overflow-x: auto; padding: 4px 0 16px;
    min-height: 400px; align-items: flex-start;
}
.kanban-column {
    flex: 1 1 0; min-width: 0;
    background: var(--bg); border-radius: var(--radius-lg);
    border: 1px solid var(--border); display: flex; flex-direction: column;
}
.kanban-column-header {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 14px;
    font-weight: 700; font-size: .85rem; text-transform: uppercase;
    letter-spacing: .03em;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.kanban-column-title { flex: 1; }
.kanban-column-count {
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700; flex-shrink: 0;
}
.kanban-cards {
    padding: 8px; display: flex; flex-direction: column; gap: 8px;
    min-height: 60px;
}

/* Kanban Card */
.kanban-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 10px 12px;
    cursor: grab; transition: box-shadow .15s, border-color .15s, transform .15s;
    user-select: none;
}
.kanban-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.kanban-card.dragging {
    opacity: .5; cursor: grabbing; transform: rotate(2deg);
    box-shadow: 0 8px 25px rgba(0,0,0,.15);
}
.priority-icon { width: 16px; height: 16px; flex-shrink: 0; }
.kanban-card-title {
    font-size: .9rem; font-weight: 600; line-height: 1.35;
    margin-bottom: 2px; color: var(--text);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.kanban-card-process {
    font-size: .75rem; color: var(--text-muted); line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
    overflow: hidden;
}
.kanban-card-footer {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 6px; gap: 6px;
}
.kanban-card-meta {
    display: flex; align-items: center; gap: 6px;
    flex: 1; min-width: 0;
}
.kanban-card-id { font-size: 11px; color: var(--text-muted); font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 2px; }
.task-origin-icon { vertical-align: middle; flex-shrink: 0; opacity: .55; }
.task-origin-icon:hover { opacity: 1; }
.kanban-card-priority { font-size: 12px; line-height: 1; display: flex; align-items: center; }
.kanban-card-due {
    font-size: 11px; color: var(--text-muted); white-space: nowrap;
}
.kanban-card-due.due-overdue, .due-overdue { color: var(--danger); font-weight: 600; }
.kanban-card-due.due-today, .due-today     { color: #d97706; font-weight: 600; }
.kanban-card-due.due-ok, .due-ok           { color: #059669; font-weight: 600; }
.kanban-card-due.due-final, .due-final     { color: var(--text-muted); font-weight: 400; }
.kanban-card-age {
    font-size: 11px; color: var(--text-muted); white-space: nowrap;
}
.kanban-card-right {
    display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.kanban-card-assignee {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--primary-light); color: var(--primary);
    font-size: 10px; font-weight: 700;
}
.kanban-card-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.kanban-card:hover .kanban-card-actions { opacity: 1; }

/* ===== TASK LIST STYLES ===== */
.task-filters {
    display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap;
}

/* ===== MULTI-SELECT FILTER BAR ===== */
.filter-bar {
    display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
    flex-shrink: 0;
}
.ms-wrap {
    position: relative; min-width: 180px; max-width: 280px; flex: 1;
}
.ms-control {
    display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
    min-height: 36px; padding: 4px 28px 4px 8px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); cursor: pointer;
    transition: border-color var(--transition);
    position: relative;
}
.ms-control:hover { border-color: var(--primary); }
.ms-wrap.open .ms-control { border-color: var(--primary); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.ms-placeholder {
    color: var(--text-muted); font-size: .82rem; white-space: nowrap;
    pointer-events: none; user-select: none;
}
.ms-tag {
    display: inline-flex; align-items: center; gap: 3px;
    background: var(--primary-light); color: var(--primary-dark);
    padding: 1px 6px 1px 8px; border-radius: 12px;
    font-size: .75rem; font-weight: 500; white-space: nowrap;
    max-width: 140px;
}
.ms-tag-text { overflow: hidden; text-overflow: ellipsis; }
.ms-tag-x {
    background: none; border: none; cursor: pointer;
    color: var(--primary); font-size: 14px; line-height: 1;
    padding: 0 2px; font-weight: 700;
}
.ms-tag-x:hover { color: var(--danger); }
.ms-arrow {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 10px; pointer-events: none;
    transition: transform .15s;
}
.ms-wrap.open .ms-arrow { transform: translateY(-50%) rotate(180deg); }
.ms-dropdown {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--surface); border: 1px solid var(--primary);
    border-top: none; border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg); z-index: 100;
    max-height: 220px; overflow: hidden;
    flex-direction: column;
}
.ms-wrap.open .ms-dropdown { display: flex; }
.ms-search-box {
    padding: 6px 8px; border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.ms-search {
    width: 100%; border: none; outline: none;
    font-family: inherit; font-size: .82rem;
    background: transparent; color: var(--text);
}
.ms-search::placeholder { color: var(--text-muted); }
.ms-options {
    overflow-y: auto; max-height: 180px; padding: 4px 0;
}
.ms-option {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px; cursor: pointer; font-size: .82rem;
    transition: background .1s;
}
.ms-option:hover { background: var(--border-light); }
.ms-option.selected { background: var(--primary-light); }
.ms-option-check {
    width: 16px; height: 16px; border-radius: 3px;
    border: 1.5px solid var(--border); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; color: white; transition: all .12s;
}
.ms-option.selected .ms-option-check {
    background: var(--primary); border-color: var(--primary);
}
.ms-option-check::after { content: ''; }
.ms-option.selected .ms-option-check::after { content: '✓'; }
.ms-option-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-empty {
    padding: 12px; text-align: center; color: var(--text-muted); font-size: .8rem;
}
.ms-clear-all {
    padding: 6px 10px; text-align: center; border-top: 1px solid var(--border);
    font-size: .78rem; color: var(--text-muted); cursor: pointer;
    flex-shrink: 0;
}
.ms-clear-all:hover { color: var(--danger); background: var(--danger-light); }

/* Date range filter */
.filter-search { flex: 0 0 100%; }
.filter-search-input {
    width: 100%; padding: 8px 12px; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: .875rem;
    background: var(--bg); color: var(--text);
    transition: border-color .15s;
}
.filter-search-input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.filter-search-input::placeholder { color: var(--text-muted); }

.date-filter {
    display: flex; flex-direction: column; gap: 2px;
    min-width: 160px; max-width: 200px; flex: 1;
}
.date-filter-label {
    font-size: .72rem; color: var(--text-muted); font-weight: 500;
    text-transform: uppercase; letter-spacing: .03em;
}
.date-filter-inputs {
    display: flex; gap: 4px; align-items: center;
}
.date-filter-inputs input[type="date"] {
    flex: 1; min-width: 0; padding: 6px 6px;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-family: inherit; font-size: .78rem; color: var(--text);
    background: var(--surface); outline: none;
    transition: border-color var(--transition);
}
.date-filter-inputs input[type="date"]:focus {
    border-color: var(--primary);
}
.date-filter-inputs input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: .5; cursor: pointer;
}
.date-filter-sep {
    color: var(--text-muted); font-size: .75rem; flex-shrink: 0;
}
.form-input-sm {
    padding: 6px 10px; font-size: .8rem; min-width: 140px;
}
.task-row { cursor: pointer; transition: background .12s; }
.task-row:hover { background: var(--primary-light); }
.task-cell-id { color: var(--text-muted); font-size: .8rem; width: 60px; white-space: nowrap; }
.task-cell-title { font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-cell-actions { width: 70px; text-align: right; white-space: nowrap; }
.task-cell-process { color: var(--text-secondary); font-size: .8rem; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-cell-watchers { font-size: .8rem; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-cell-date { white-space: nowrap; font-size: .8rem; color: var(--text-secondary); }
.table-wrap { overflow-x: auto; }
.data-table th, .data-table td { white-space: nowrap; }

/* Task status badges */
.task-status-badge {
    display: inline-block; padding: 2px 10px; border-radius: 10px;
    font-size: .75rem; font-weight: 600; white-space: nowrap;
}
.status-new { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.status-progress { background: var(--primary-light); color: var(--primary); }
.status-review { background: var(--warning-light); color: var(--warning); }
.status-done { background: var(--success-light); color: var(--success); }
.status-cancelled { background: var(--danger-light); color: var(--danger); }

/* Task priority badges */
.task-priority-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 10px; border-radius: 10px;
    font-size: .75rem; font-weight: 600; white-space: nowrap;
}
.task-priority-badge .priority-icon { width: 14px; height: 14px; }
.priority-low { background: #ecfdf5; color: #059669; }
.priority-medium { background: #fef9c3; color: #ca8a04; }
.priority-high { background: #ffedd5; color: #ea580c; }
.priority-urgent { background: var(--danger-light); color: var(--danger); }

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

/* Form helpers */
.form-row { display: flex; gap: 14px; }
.form-group-half { flex: 1; }
.empty-cell { text-align: center; color: var(--text-muted); padding: 32px !important; }

/* Nav divider */
.nav-divider {
    height: 1px; background: var(--border); margin: 8px 12px;
}

/* ===== SETTINGS ===== */
.settings-layout {
    display: flex; gap: 24px; min-height: 400px;
}
.settings-sidebar {
    width: 200px; flex-shrink: 0;
    display: flex; flex-direction: column; gap: 2px;
}
.settings-nav-item {
    display: block; padding: 8px 14px; border-radius: var(--radius);
    font-size: .85rem; font-weight: 500; color: var(--text-secondary);
    transition: all var(--transition); text-decoration: none;
}
.settings-nav-item:hover { background: var(--bg); color: var(--text); }
.settings-nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

.settings-content { flex: 1; min-width: 0; }

.settings-section {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 24px;
}
.settings-section-header { margin-bottom: 18px; }
.settings-section-header h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.settings-section-desc { font-size: .82rem; color: var(--text-muted); }

/* Status list */
.status-list {
    display: flex; flex-direction: column; gap: 6px;
}
.status-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; background: var(--bg);
    border: 1px solid var(--border); border-radius: var(--radius);
    cursor: grab; transition: all .15s;
}
.status-item:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.status-item.dragging { opacity: .5; cursor: grabbing; }
.status-item-drag {
    color: var(--text-muted); font-size: 14px; cursor: grab;
    letter-spacing: 1px; user-select: none;
}
.status-dot-preview {
    width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.status-item-name { font-weight: 600; flex: 1; font-size: .9rem; }
.status-item-key {
    font-size: .75rem; color: var(--text-muted); font-family: monospace;
    background: var(--surface); padding: 2px 8px; border-radius: 4px;
}
.status-item-final {
    font-size: .7rem; color: var(--success); font-weight: 600;
    background: var(--success-light); padding: 2px 8px; border-radius: 10px;
    text-transform: uppercase;
}
.status-item-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.status-item:hover .status-item-actions { opacity: 1; }

/* Color presets */
.color-presets {
    display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px;
}
.color-preset {
    width: 32px; height: 32px; border: 2px solid var(--border);
    border-radius: 8px; cursor: pointer; padding: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface); transition: all .15s;
}
.color-preset span {
    width: 18px; height: 18px; border-radius: 50%;
}
.color-preset:hover { border-color: var(--text-secondary); transform: scale(1.1); }
.color-preset.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }

/* ===== ORG CHART ===== */
#dept-content {
    display: flex; flex-direction: column; flex: 1; min-height: 0;
}
.orgchart-toolbar {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 12px; padding: 8px 12px;
    background: var(--surface); border-radius: var(--radius);
    border: 1px solid var(--border); flex-shrink: 0;
}
.orgchart-hint { font-size: 12px; color: var(--text-muted); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.orgchart-canvas-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    background:
        radial-gradient(circle, var(--border) 1px, transparent 1px);
    background-size: 24px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: auto;
}
.orgchart-canvas {
    position: relative;
    min-width: 100%;
    min-height: 100%;
}
.orgchart-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}
.orgchart-arrow {
    fill: none; stroke: var(--primary); stroke-width: 2;
    stroke-dasharray: none;
}
.orgchart-arrowhead { fill: var(--primary); }
.orgchart-drag-line {
    stroke: var(--primary); stroke-width: 2; stroke-dasharray: 6 4;
    opacity: .6;
}

/* Card */
.orgchart-card {
    position: absolute;
    width: 180px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    cursor: grab;
    user-select: none;
    z-index: 2;
    transition: box-shadow .15s, border-color .15s;
}
.orgchart-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.orgchart-card.dragging { cursor: grabbing; box-shadow: 0 8px 25px rgba(0,0,0,.15); z-index: 10; border-color: var(--primary); }
.orgchart-card-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 10px 10px 4px; gap: 4px;
}
.orgchart-card-title {
    font-size: 13px; font-weight: 600; color: var(--text);
    line-height: 1.3; flex: 1;
}
.orgchart-card-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.orgchart-card:hover .orgchart-card-actions { opacity: 1; }
.orgchart-btn {
    width: 22px; height: 22px; border: none; background: none;
    cursor: pointer; border-radius: 4px; font-size: 12px;
    display: flex; align-items: center; justify-content: center;
}
.orgchart-btn:hover { background: var(--bg); }
.orgchart-card-info {
    padding: 2px 10px 8px;
    display: flex; align-items: center; gap: 8px;
    font-size: 11px; color: var(--text-muted);
}
.orgchart-card-parent {
    color: var(--primary); font-weight: 500;
}
.orgchart-card-head {
    padding: 0 10px 6px;
    display: flex; flex-direction: column; gap: 1px;
}
.orgchart-card-head-pos {
    font-size: 11px; color: var(--text-secondary); font-weight: 500;
    line-height: 1.3;
}
.orgchart-card-head-emp {
    font-size: 11px; color: var(--success); font-weight: 600;
    padding-left: 18px;
    line-height: 1.3;
}

/* Positions toggle & list */
.orgchart-toggle-pos {
    cursor: pointer; border-radius: 4px; padding: 1px 4px;
    transition: background .15s;
}
.orgchart-toggle-pos:hover { background: var(--primary-light); color: var(--primary); }
.orgchart-pos-list {
    max-height: 0; overflow: hidden;
    transition: max-height .25s ease, padding .15s ease;
    padding: 0 10px;
    border-top: 1px solid transparent;
}
.orgchart-pos-list.open {
    max-height: 300px; overflow-y: auto;
    padding: 6px 10px;
    border-top-color: var(--border);
}
.orgchart-pos-item {
    display: flex; flex-direction: column;
    padding: 3px 0;
    border-bottom: 1px dashed var(--border-light);
}
.orgchart-pos-item:last-child { border-bottom: none; }
.orgchart-pos-name {
    font-size: 11px; color: var(--text-secondary); font-weight: 500;
    line-height: 1.3;
}
.orgchart-pos-emp {
    font-size: 10px; color: var(--success); font-weight: 500;
    padding-left: 8px; line-height: 1.3;
}

/* Connector dot */
.orgchart-connector {
    position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%);
    width: 14px; height: 14px;
    background: var(--primary-light); border: 2px solid var(--primary);
    border-radius: 50%; cursor: crosshair;
    z-index: 3; opacity: 0; transition: opacity .15s;
}
.orgchart-card:hover .orgchart-connector { opacity: 1; }
.orgchart-connector:hover { background: var(--primary); transform: translateX(-50%) scale(1.2); }

/* Unlink button */
.orgchart-unlink {
    position: absolute; top: -8px; right: -8px;
    width: 18px; height: 18px;
    background: var(--danger); color: white; border: 2px solid var(--surface);
    border-radius: 50%; cursor: pointer;
    font-size: 10px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .15s; z-index: 4;
}
.orgchart-card:hover .orgchart-unlink { opacity: 1; }
.orgchart-unlink:hover { background: #dc2626; transform: scale(1.15); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .right-panel { display: none; }
}

/* ═══ Comments ═══ */
.comments-list {
    max-height: 320px; overflow-y: auto; margin-bottom: 12px;
    display: flex; flex-direction: column; gap: 2px;
}
.comments-empty { color: var(--text-secondary); font-size: 13px; padding: 8px 0; }
.comment-item {
    display: flex; gap: 10px; padding: 8px 10px; border-radius: 8px;
    transition: background .15s;
}
.comment-item:hover { background: var(--bg-secondary); }
.comment-avatar {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    background: var(--primary); color: #fff; font-size: 12px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
}
.comment-body { flex: 1; min-width: 0; }
.comment-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.comment-author { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.comment-time { font-size: 11px; color: var(--text-secondary); }
.comment-edited { font-size: 11px; color: var(--text-secondary); font-style: italic; }
.comment-text {
    font-size: 13px; color: var(--text-primary); line-height: 1.45;
    white-space: pre-wrap; word-break: break-word;
}
.comment-text.comment-editing {
    background: var(--bg-primary); border: 1.5px solid var(--primary);
    border-radius: 6px; padding: 6px 8px; outline: none;
}
.comment-actions {
    display: none; gap: 4px; margin-top: 2px;
}
.comment-item:hover .comment-actions { display: flex; }
.comment-text.comment-editing ~ .comment-actions { display: flex; }
.comment-action-btn {
    background: none; border: none; cursor: pointer; font-size: 13px;
    color: var(--text-secondary); padding: 2px 4px; border-radius: 4px;
    transition: color .15s, background .15s;
}
.comment-action-btn:hover { color: var(--text-primary); background: var(--bg-secondary); }
.comment-del-btn:hover { color: var(--danger); }
.comment-save-btn { color: var(--success, #22c55e); }
.comment-save-btn:hover { color: #16a34a; }

.comment-add-form {
    display: flex; gap: 8px; align-items: flex-end;
}
.comment-input {
    flex: 1; min-height: 36px; max-height: 120px; overflow-y: auto;
    padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 8px;
    font-size: 13px; line-height: 1.4; outline: none;
    transition: border-color .15s;
}
.comment-input:focus { border-color: var(--primary); }
.comment-input:empty::before {
    content: attr(data-placeholder); color: var(--text-secondary); pointer-events: none;
}
.comment-count-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    font-size: 11px; font-weight: 600; background: var(--bg-secondary); color: var(--text-secondary);
    margin-left: 4px; vertical-align: middle;
}

/* ═══ Reports ═══ */
.rpt-filters {
    display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap;
    padding: 16px 20px; background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: 10px; margin-bottom: 24px;
}
.rpt-filter-group { display: flex; flex-direction: column; gap: 4px; }
.rpt-filter-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.rpt-period-row { display: flex; align-items: center; gap: 8px; }
.rpt-quick-periods { display: flex; gap: 4px; }
.rpt-period-btn {
    font-size: 11px; padding: 3px 8px; border-radius: 4px;
    background: var(--bg-secondary); color: var(--text-secondary); border: 1px solid var(--border);
    cursor: pointer; transition: all .15s;
}
.rpt-period-btn.active, .rpt-period-btn:hover {
    background: var(--primary); color: #fff; border-color: var(--primary);
}

.rpt-header {
    display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px;
}
.rpt-header h3 { margin: 0; font-size: 18px; }
.rpt-period-label { font-size: 13px; color: var(--text-secondary); }

.rpt-summary {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px; margin-bottom: 20px;
}
.rpt-card {
    padding: 16px; background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: 10px; text-align: center;
}
.rpt-card-success { border-left: 3px solid #22c55e; }
.rpt-card-warning { border-left: 3px solid #f59e0b; }
.rpt-card-danger  { border-left: 3px solid #ef4444; }
.rpt-card-value { font-size: 28px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.rpt-card-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.rpt-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.rpt-panel {
    padding: 16px 20px; background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: 10px;
}
.rpt-panel-title { margin: 0 0 12px; font-size: 14px; font-weight: 600; }

/* Stacked bar */
.rpt-bar-stacked {
    display: flex; height: 24px; border-radius: 6px; overflow: hidden; margin-bottom: 8px;
}
.rpt-bar-seg { min-width: 4px; transition: width .3s; }
.rpt-bar-green { background: #22c55e; }
.rpt-bar-red   { background: #ef4444; }
.rpt-bar-gray  { background: #cbd5e1; }
.rpt-bar-legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-secondary); }
.rpt-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }

/* Priority grid */
.rpt-prio-grid { display: flex; flex-direction: column; gap: 6px; }
.rpt-prio-row { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.rpt-prio-label { font-weight: 600; min-width: 70px; }
.rpt-prio-val { color: var(--text-secondary); }

/* Status bars */
.rpt-status-bars { display: flex; flex-direction: column; gap: 8px; }
.rpt-status-row { display: flex; align-items: center; gap: 10px; }
.rpt-status-name { font-size: 13px; min-width: 100px; flex-shrink: 0; }
.rpt-status-bar-bg { flex: 1; height: 18px; background: var(--bg-secondary); border-radius: 4px; overflow: hidden; }
.rpt-status-bar-fill { height: 100%; border-radius: 4px; transition: width .4s; }
.rpt-status-cnt { font-size: 13px; font-weight: 600; min-width: 28px; text-align: right; }

/* Daily chart */
.rpt-chart {
    display: flex; align-items: flex-end; gap: 2px; height: 150px;
    overflow-x: auto; padding-bottom: 24px; position: relative;
}
.rpt-chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.rpt-chart-bar-group {
    display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 18px; max-width: 40px; position: relative; height: 100%;
}
.rpt-chart-bars {
    display: flex; gap: 2px; align-items: flex-end; width: 100%; height: 100%;
}
.rpt-chart-bar {
    flex: 1; border-radius: 2px 2px 0 0; min-height: 2px; transition: height .3s;
}
.rpt-chart-bar-created  { background: #3b82f6; }
.rpt-chart-bar-completed { background: #22c55e; }
.rpt-chart-label {
    font-size: 9px; color: var(--text-muted); white-space: nowrap;
    position: absolute; bottom: -20px; transform: rotate(-45deg); transform-origin: top left;
}

@media (max-width: 768px) {
    .rpt-panels { grid-template-columns: 1fr; }
    .rpt-summary { grid-template-columns: repeat(2, 1fr); }
    .rpt-filters { flex-direction: column; align-items: stretch; }
    .rpt-period-row { flex-wrap: wrap; }
}

/* Comparison table */
.cmp-table-wrap { overflow-x: auto; margin-top: 4px; }
.cmp-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
    background: var(--bg-primary); border-radius: 10px; overflow: hidden;
    border: 1px solid var(--border);
}
.cmp-th {
    padding: 10px 12px; text-align: left; font-weight: 600; font-size: 12px;
    color: var(--text-secondary); background: var(--bg-secondary);
    border-bottom: 1px solid var(--border); white-space: nowrap;
    user-select: none; position: relative;
}
.cmp-th:not(.cmp-th-name) { text-align: right; }
.cmp-th:not(.cmp-th-name):hover { color: var(--text-primary); }
.cmp-th-sorted { color: var(--primary) !important; }
.cmp-th-sorted::after { content: ' ▾'; font-size: 10px; }
.cmp-th-sorted[data-sort="asc"]::after { content: ' ▴'; }
.cmp-td {
    padding: 10px 12px; border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.cmp-td:not(.cmp-td-name) { text-align: right; font-variant-numeric: tabular-nums; }
.cmp-row:last-child .cmp-td { border-bottom: none; }
.cmp-row:hover .cmp-td { background: var(--bg-secondary); }
.cmp-td-name { min-width: 160px; }
.cmp-emp-name { font-weight: 500; color: var(--text-primary); }
.cmp-emp-pos { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.cmp-cell-danger { color: #ef4444; font-weight: 600; }
.cmp-bar-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.cmp-mini-bar { height: 6px; border-radius: 3px; min-width: 2px; transition: width .3s; }

/* ═══ Task View (inline edit) ═══ */
.task-view { }

.tv-modal-title {
    display: flex !important; align-items: center; gap: 6px; flex: 1; min-width: 0;
}
.tv-header-id { color: var(--text-muted); font-weight: 500; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; flex-shrink: 0; }
.tv-header-input {
    flex: 1; min-width: 0; border: none; outline: none;
    font-size: 18px; font-weight: 600; color: var(--text-primary);
    background: transparent; padding: 2px 6px;
    border-bottom: 2px solid transparent; transition: border-color .2s;
}
.tv-header-input:focus { border-bottom-color: var(--primary); }
.tv-header-input::placeholder { color: var(--text-secondary); }

.tv-source-line { font-size: 12px; color: var(--text-secondary); margin-bottom: 14px; }
.tv-source-link { color: var(--primary); text-decoration: none; cursor: pointer; }
.tv-source-link:hover { text-decoration: underline; }
.sch-fieldset[disabled] { opacity: .6; pointer-events: none; }
.sch-fieldset[disabled] .tv-source-link { pointer-events: auto; opacity: 1; }

.tv-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 0; margin-bottom: 20px;
}
.tv-row {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 4px;
    min-height: 36px;
}
.tv-row:last-child:nth-child(odd) { grid-column: 1 / -1; }
.tv-label {
    font-size: 12px; color: var(--text-secondary); font-weight: 500;
    min-width: 90px; flex-shrink: 0;
}
.tv-select, .tv-date {
    flex: 1; border: none; outline: none; background: transparent;
    font-size: 13px; color: var(--text-primary); cursor: pointer;
    padding: 2px 4px; border-radius: 4px; transition: background .15s;
    -webkit-appearance: none; appearance: none;
    min-width: 0;
}
.tv-select:hover, .tv-date:hover { background: var(--bg-secondary); }
.tv-select:focus, .tv-date:focus { background: var(--bg-secondary); outline: 1.5px solid var(--primary); }
.tv-watchers-wrap { flex: 1; min-width: 0; }

.tv-section { margin-bottom: 16px; }
.tv-section-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.tv-description { min-height: 60px; }

.tv-save-indicator {
    font-size: 12px; color: var(--success, #22c55e); font-weight: 500;
    margin-left: auto; opacity: 0; transition: opacity .3s;
    padding: 2px 8px;
}
.tv-save-indicator.visible { opacity: 1; }

.modal-header { display: flex; align-items: center; }

/* ═══════════════════ ADMIN PANEL ═══════════════════ */
.adm-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.adm-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    box-shadow: var(--shadow);
}
.adm-card-icon {
    width: 48px; height: 48px; min-width: 48px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
}
.adm-card-body { flex: 1; min-width: 0; }
.adm-card-value {
    font-size: 28px; font-weight: 700; line-height: 1.2;
    color: var(--text);
}
.adm-card-label {
    font-size: 13px; font-weight: 500; color: var(--text-secondary);
    margin-top: 2px;
}
.adm-card-sub {
    font-size: 12px; color: var(--text-muted); margin-top: 4px;
}

.adm-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}
.adm-chart-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}
.adm-chart-block h3 {
    font-size: 14px; font-weight: 600; color: var(--text);
    margin-bottom: 16px;
}
.adm-chart-block canvas {
    width: 100%;
}

.adm-users-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}
.adm-users-section h3 {
    font-size: 14px; font-weight: 600; color: var(--text);
    margin-bottom: 16px;
}
.adm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.adm-table th {
    text-align: left; padding: 10px 12px;
    font-weight: 600; color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.adm-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
}
.adm-table tr:hover td {
    background: var(--bg);
}

/* ═══════════════════ HELP / СПРАВКА ═══════════════════ */
.help-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0;
    height: calc(100vh - 64px);
    margin: -24px;
}
.help-sidebar {
    position: sticky; top: 0;
    height: calc(100vh - 64px);
    overflow-y: auto;
    border-right: 1px solid var(--border);
    background: var(--surface);
    padding: 20px 0;
}
.help-sidebar-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-muted);
    padding: 0 20px 10px;
}
.help-toc { display: flex; flex-direction: column; gap: 1px; }
.help-toc-item {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 20px; font-size: 13px; font-weight: 500;
    color: var(--text-secondary); text-decoration: none;
    transition: all .15s;
    border-left: 3px solid transparent;
}
.help-toc-item:hover { color: var(--text); background: var(--bg); }
.help-toc-item.active {
    color: var(--primary); background: var(--primary-light);
    border-left-color: var(--primary); font-weight: 600;
}


.help-content {
    overflow-y: auto;
    height: calc(100vh - 64px);
    padding: 24px 36px 48px;
    scroll-behavior: smooth;
}
.help-hero {
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.help-hero h2 {
    font-size: 22px; font-weight: 700; color: var(--text);
    margin-bottom: 6px;
}
.help-hero p {
    font-size: 14px; color: var(--text-secondary); line-height: 1.5;
}

.help-section {
    margin-bottom: 24px;
    scroll-margin-top: 16px;
}
.help-section-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-light);
}

.help-section-header h3 {
    font-size: 16px; font-weight: 700; color: var(--text);
}

.help-steps { display: flex; flex-direction: column; gap: 2px; }
.help-step {
    display: flex; gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius);
    transition: background .15s;
}
.help-step:hover { background: var(--bg); }
.help-step-num {
    width: 24px; height: 24px; min-width: 24px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin-top: 1px;
}
.help-step-body { flex: 1; min-width: 0; }
.help-step-title {
    font-size: 13px; font-weight: 600; color: var(--text);
    margin-bottom: 2px;
}
.help-step-text {
    font-size: 12.5px; color: var(--text-secondary); line-height: 1.6;
}
.help-step-text code {
    background: var(--bg); padding: 1px 5px;
    border-radius: 4px; font-size: 11.5px; font-weight: 600;
    color: var(--primary);
}
.help-step-text b { color: var(--text); font-weight: 600; }
.help-step-text em { font-style: italic; color: var(--text-muted); }

.help-go-btn {
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: 5px; padding: 4px 10px;
    font-size: 11.5px; font-weight: 600;
    color: var(--primary); background: var(--primary-light);
    border: none; border-radius: 6px;
    cursor: pointer; transition: all .15s;
}
.help-go-btn:hover {
    background: var(--primary); color: white;
}

.help-footer {
    text-align: center; padding: 20px 0;
    border-top: 1px solid var(--border);
    margin-top: 12px;
}
.help-footer p {
    font-size: 13px; color: var(--text-muted);
}
.help-footer a {
    color: var(--primary); font-weight: 500; text-decoration: none;
}
.help-footer a:hover { text-decoration: underline; }


@media (max-width: 768px) {
    .sidebar { width: 56px; min-width: 56px; }
    .sidebar-header { padding: 12px 8px; }
    .sidebar-header .btn-back span,
    .sidebar-header .project-title { display: none; }
    .nav-item span:last-child { display: none; }
    .nav-item { justify-content: center; padding: 10px; }
    .workspace { padding: 16px; }
    .tv-grid { grid-template-columns: 1fr; }
    .profile-panel { justify-content: center; padding: 8px; }
    .profile-email, .profile-panel .btn { display: none; }
    .help-layout { grid-template-columns: 1fr; }
    .help-sidebar { display: none; }
    .help-content { padding: 16px 14px 32px; }
}
