/* ==========================================================================
   Entrepreneur Workspace - Dark Theme
   ========================================================================== */

:root {
    --bg: #0e1726;
    --bg-2: #14213d;
    --bg-3: #1a2747;
    --ink: #f5f7fa;
    --ink-soft: #a8b3c7;
    --ink-mute: #6a7a96;
    --rule: #243358;
    --rule-soft: #1d2a4a;
    --accent: #6366f1;
    --accent-2: #8b5cf6;
    --accent-soft: #818cf8;
    --success: #10b981;
    --warn: #f59e0b;
    --danger: #ef4444;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Heebo', 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-soft); }
img { max-width: 100%; height: auto; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container.wide { max-width: 1400px; }
.container.narrow { max-width: 720px; }

/* ==========================================================================
   Header
   ========================================================================== */
.app-header {
    border-bottom: 1px solid var(--rule-soft);
    padding: 14px 0;
    position: sticky;
    top: 0;
    background: rgba(14, 23, 38, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 700;
    font-size: 17px;
}
.brand-mark {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: 3px;
    box-shadow: 0 0 12px var(--accent);
}
.brand-mark.big { width: 32px; height: 32px; border-radius: 8px; }
.nav { display: flex; gap: 24px; }
.nav a {
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 500;
    padding: 6px 0;
}
.nav a:hover { color: var(--ink); }
.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}
.user-name { color: var(--ink); font-weight: 600; }
.user-role {
    padding: 2px 8px;
    background: var(--accent);
    color: white;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.user-role[style*="guest"] { background: var(--ink-mute); }
.logout {
    color: var(--ink-mute);
    font-size: 13px;
    padding-inline-start: 12px;
    border-inline-start: 1px solid var(--rule);
}
.logout:hover { color: var(--danger); }
.change-pw {
    color: var(--ink-mute);
    font-size: 16px;
    text-decoration: none;
    transition: color 0.2s;
}
.change-pw:hover { color: var(--accent); }

/* ==========================================================================
   Main
   ========================================================================== */
.app-main { padding: 32px 0 80px; }
.page-header { margin-bottom: 32px; }
.page-header.with-action {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    flex-wrap: wrap;
}
.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}
.page-header .lead {
    color: var(--ink-soft);
    font-size: 16px;
}
.header-actions { display: flex; gap: 12px; align-items: center; }

.flash {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}
.flash-success { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid var(--success); }
.flash-error { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid var(--danger); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 10px 16px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { display: block; width: 100%; padding: 12px 16px; }
.btn-primary {
    background: var(--accent);
    color: white;
}
.btn-primary:hover { background: var(--accent-soft); color: white; }
.btn-link {
    background: transparent;
    color: var(--ink-soft);
    padding: 10px 0;
}
.btn-link:hover { color: var(--ink); }
.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 6px 12px;
    font-size: 13px;
}
.btn-danger:hover { background: var(--danger); color: white; }

/* ==========================================================================
   Dashboard
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 48px;
}
.stat-card {
    padding: 28px;
    background: var(--bg-2);
    border: 1px solid var(--rule);
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s;
    color: var(--ink);
    display: block;
}
a.stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.stat-num {
    display: block;
    font-size: 42px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
    font-family: 'Inter', sans-serif;
}
.stat-label { font-size: 14px; color: var(--ink-soft); }

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
}
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.section-head h2 { font-size: 22px; font-weight: 700; }

.dash-projects {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.project-mini {
    display: block;
    padding: 16px 20px;
    background: var(--bg-2);
    border: 1px solid var(--rule);
    border-radius: 6px;
    color: var(--ink);
    transition: all 0.15s;
}
.project-mini:hover {
    border-color: var(--accent);
    transform: translateX(-4px);
}
.project-mini-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}
.project-mini-head h3 { font-size: 16px; font-weight: 600; }
.creator { font-size: 12px; color: var(--ink-soft); }
.project-mini-meta { font-size: 12px; color: var(--ink-mute); margin-top: 6px; }

.activity-feed {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.activity-feed li {
    padding: 12px;
    background: var(--bg-2);
    border-radius: 6px;
    border-inline-start: 3px solid var(--accent);
    font-size: 13px;
    line-height: 1.5;
}
.activity-feed .actor {
    font-weight: 600;
    color: var(--ink);
    margin-inline-end: 4px;
}
.activity-feed .verb { color: var(--ink-soft); }
.activity-feed time {
    display: block;
    font-size: 11px;
    color: var(--ink-mute);
    margin-top: 4px;
    font-family: 'Inter', sans-serif;
}
.activity-feed.small li { padding: 10px; font-size: 12px; }

/* ==========================================================================
   Ideas
   ========================================================================== */
.ideas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.idea-card {
    padding: 20px;
    background: var(--bg-2);
    border: 1px solid var(--rule);
    border-radius: 8px;
    transition: all 0.2s;
    position: relative;
}
.idea-card:hover { border-color: var(--accent); }
.idea-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 8px;
    margin-bottom: 8px;
}
.idea-head h3 { font-size: 17px; font-weight: 600; flex: 1; }
.status-badge {
    padding: 2px 10px;
    background: var(--accent);
    color: white;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}
.status-נגנז .status-badge { background: var(--ink-mute); }
.status-הומר-לפרויקט .status-badge { background: var(--success); }
.idea-card p {
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}
.idea-foot {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--ink-mute);
    padding-top: 12px;
    border-top: 1px solid var(--rule-soft);
}
.idea-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--rule-soft);
}
.action-btn {
    background: transparent;
    color: var(--ink-soft);
    border: 1px solid var(--rule);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}
.action-btn:hover { color: var(--ink); border-color: var(--ink-soft); }
.action-btn.danger { color: var(--danger); border-color: var(--rule); }
.action-btn.danger:hover { background: var(--danger); color: white; }

/* ==========================================================================
   Projects
   ========================================================================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.project-card {
    padding: 24px;
    background: var(--bg-2);
    border: 1px solid var(--rule);
    border-radius: 8px;
    color: var(--ink);
    transition: all 0.2s;
    display: block;
}
.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}
.project-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}
.project-card-head h3 { font-size: 18px; font-weight: 600; }
.project-desc {
    color: var(--ink-soft);
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}
.project-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--ink-mute);
}

.progress {
    position: relative;
    height: 6px;
    background: var(--bg-3);
    border-radius: 100px;
    overflow: hidden;
    margin-top: 12px;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width 0.3s;
}
.progress-label {
    position: absolute;
    top: -22px;
    inset-inline-end: 0;
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
}

/* Project View */
.project-description {
    padding: 16px 20px;
    background: var(--bg-2);
    border-radius: 6px;
    margin-bottom: 24px;
    line-height: 1.7;
    color: var(--ink-soft);
    border-inline-start: 3px solid var(--accent);
}
.project-links {
    margin-bottom: 32px;
    padding: 16px 20px;
    background: var(--bg-2);
    border-radius: 6px;
}
.project-links h3 { font-size: 14px; margin-bottom: 8px; color: var(--ink-soft); }
.project-links ul { list-style: none; }
.project-links li {
    padding: 4px 0;
    font-size: 13px;
}
.project-links a {
    color: var(--accent);
    word-break: break-all;
}

.project-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
}
.project-main { min-width: 0; }
.project-aside {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.aside-section {
    padding: 20px;
    background: var(--bg-2);
    border-radius: 8px;
}
.aside-section h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-soft);
    margin-bottom: 14px;
}

/* Kanban */
.kanban-section { margin-bottom: 32px; }
.kanban {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.kanban-col {
    background: var(--bg-2);
    border-radius: 6px;
    padding: 12px;
    min-height: 200px;
}
.kanban-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--rule-soft);
}
.kanban-head h3 { font-size: 14px; font-weight: 600; }
.kanban-head .count {
    background: var(--bg-3);
    color: var(--ink-soft);
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
}
.kanban-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.task-card {
    background: var(--bg);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 12px;
    transition: all 0.15s;
}
.task-card:hover { border-color: var(--accent-soft); }
.task-card h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}
.task-card p {
    font-size: 13px;
    color: var(--ink-soft);
    margin-bottom: 8px;
    line-height: 1.4;
}
.task-foot {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--ink-mute);
}
.assignee.empty { color: var(--ink-mute); font-style: italic; }
.task-actions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--rule-soft);
}
.task-btn {
    background: transparent;
    color: var(--ink-soft);
    border: 1px solid var(--rule);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.task-btn:hover { border-color: var(--accent); color: var(--accent); }
.task-btn.danger:hover { border-color: var(--danger); color: var(--danger); }

/* Notes */
.notes-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-2);
    border-radius: 8px;
}
.note-form {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.note-form textarea {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--rule);
    border-radius: 4px;
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}
.notes-feed { display: flex; flex-direction: column; gap: 8px; }
.note {
    padding: 10px 12px;
    background: var(--bg);
    border-radius: 4px;
    border-inline-start: 2px solid var(--accent);
}
.note p { font-size: 14px; margin-bottom: 6px; }
.note footer { font-size: 11px; color: var(--ink-mute); }

/* ==========================================================================
   Forms
   ========================================================================== */
.form-card {
    padding: 32px;
    background: var(--bg-2);
    border: 1px solid var(--rule);
    border-radius: 8px;
}
.form-field { margin-bottom: 20px; }
.form-field label {
    display: block;
    font-size: 13px;
    color: var(--ink-soft);
    margin-bottom: 6px;
    font-weight: 500;
}
.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--rule);
    border-radius: 6px;
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--accent);
}
.form-actions {
    display: flex;
    justify-content: end;
    gap: 12px;
    margin-top: 24px;
}

/* ==========================================================================
   Tables
   ========================================================================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-2);
    border-radius: 6px;
    overflow: hidden;
}
.data-table th, .data-table td {
    padding: 12px 16px;
    text-align: start;
    border-bottom: 1px solid var(--rule-soft);
}
.data-table th {
    background: var(--bg-3);
    font-weight: 600;
    color: var(--ink-soft);
    font-size: 13px;
}
.data-table td { font-size: 14px; }
.data-table code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    color: var(--accent);
}
.role-badge {
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 500;
}
.role-admin { background: var(--accent); color: white; }
.role-guest { background: var(--ink-mute); color: white; }

/* ==========================================================================
   Login
   ========================================================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-card {
    max-width: 400px;
    width: 100%;
    padding: 40px;
    background: var(--bg-2);
    border: 1px solid var(--rule);
    border-radius: 12px;
}
.login-brand {
    text-align: center;
    margin-bottom: 32px;
}
.login-brand h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 12px 0 4px;
}
.login-brand p {
    color: var(--ink-soft);
    font-size: 14px;
}
.login-brand .brand-mark {
    display: inline-block;
    margin-bottom: 8px;
}
.login-hint {
    margin-top: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--ink-mute);
}
.login-hint code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--accent);
}

/* ==========================================================================
   Empty state
   ========================================================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--ink-mute);
    font-size: 15px;
    background: var(--bg-2);
    border-radius: 8px;
    border: 1px dashed var(--rule);
}
.empty { font-size: 12px; color: var(--ink-mute); font-style: italic; margin-top: 8px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
    .dashboard-grid,
    .project-layout { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .kanban { grid-template-columns: 1fr; }
    .nav { gap: 16px; }
    .nav a { font-size: 13px; }
    .user-name { display: none; }
}
@media (max-width: 600px) {
    .container { padding: 0 16px; }
    .header-inner { gap: 12px; flex-wrap: wrap; }
    .nav { order: 3; width: 100%; justify-content: space-around; }
    .page-header h1 { font-size: 24px; }
    .project-card-head { flex-wrap: wrap; }
}