/* HousePlanner 3D – pastelowy, „CAD-owy” interfejs (wg makiet w /Mockup) */
:root {
    --bg: #f5f6f2;
    --surface: #ffffff;
    --surface-2: #f0f2ec;
    --border: #e1e4dc;
    --text: #22272b;
    --muted: #6b7178;
    --primary: #2f6fe4;
    --primary-soft: #e6eefc;
    --danger: #d64545;
    --ok: #3d9a6a;
    /* paleta pastelowa (również w 3D) */
    --beige: #efe2cc;
    --mint: #cfe8dc;
    --olive: #c8d3a8;
    --brick: #e3a588;
    --graphite: #50565c;
    --gantt-label: 230px;
    --radius: 12px;
}

html, body { height: 100%; }
body.app {
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 15px;
}
a { color: var(--primary); }

.app-header {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 56px;
    padding: 0 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 17px; }
.brand-logo {
    display: grid; place-items: center; width: 32px; height: 32px;
    border-radius: 9px; background: var(--mint); color: #2b6b4f; font-size: 18px;
}
.app-nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.app-nav a:hover { color: var(--text); }

.project-nav { background: var(--surface); border-bottom: 1px solid var(--border); }
.project-nav-title { font-weight: 600; padding: 10px 0; display: flex; align-items: center; gap: 8px; }
.project-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.project-tabs a {
    padding: 12px 14px; color: var(--muted); text-decoration: none; font-weight: 500;
    border-bottom: 2px solid transparent;
}
.project-tabs a:hover { color: var(--text); }
.project-tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }

.app-main { padding-top: 28px; padding-bottom: 48px; }
.app-main.fullscreen { padding: 0; max-width: none; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1, .narrow h1 { font-size: 26px; font-weight: 700; margin: 0 0 4px; }
.narrow { max-width: 760px; margin: 0 auto; }
.section-title { font-size: 16px; font-weight: 600; margin: 0 0 14px; }
.section-title .count { color: var(--muted); font-weight: 500; margin-left: 4px; }

.panel, .card-form {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px;
}
.panel-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }

.empty {
    text-align: center; padding: 40px; border: 1px dashed var(--border); border-radius: var(--radius);
    background: var(--surface); color: var(--muted);
}
.empty i { font-size: 36px; display: block; margin-bottom: 8px; }

.role-badge { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* Landing */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; padding: 40px 0; }
.hero h1 { font-size: 42px; font-weight: 800; letter-spacing: -0.02em; }
.hero-features { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.feature {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px; display: flex; flex-direction: column; gap: 2px;
}
.feature i { font-size: 22px; color: var(--primary); }
.feature span { color: var(--muted); font-size: 13px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }

/* Dashboard */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.project-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column;
}
.project-card .thumb { position: relative; display: block; aspect-ratio: 16 / 10; background: var(--surface-2); }
.project-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.project-card .thumb .badge { position: absolute; top: 10px; left: 10px; }
.thumb-placeholder { display: grid; place-items: center; height: 100%; font-size: 44px; color: #b8c2b0;
    background: linear-gradient(135deg, var(--mint), var(--beige)); }
.project-card .body { padding: 14px 16px 6px; flex: 1; }
.project-card h3 { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.project-card h3 a { color: var(--text); text-decoration: none; }
.project-card .desc { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.progress-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.progress-row .progress { flex: 1; height: 6px; }
.progress-bar { background: var(--ok); }
.project-card .meta { display: flex; gap: 12px; color: var(--muted); font-size: 12px; margin-top: 8px; flex-wrap: wrap; }
.project-card .actions { display: flex; gap: 6px; padding: 10px 16px 14px; flex-wrap: wrap; }

/* Members */
.member-list { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.member-list li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.member-list li:last-child { border-bottom: 0; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--beige); font-weight: 700; }

/* Stage colors (galeria, dziennik, Gantt) */
.stage-0 { --stage: #b9c3cc; } .stage-1 { --stage: #c9a77c; } .stage-2 { --stage: #9fb4c7; }
.stage-3 { --stage: #e3a588; } .stage-4 { --stage: #d98c6c; } .stage-5 { --stage: #e8c95e; }
.stage-6 { --stage: #c8d3a8; } .stage-7 { --stage: #a6d4bf; } .stage-8 { --stage: #8fbf7f; }
.stage-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--stage); margin-right: 8px; }
.stage-badge { background: var(--stage); color: var(--text); font-weight: 600; }

/* Diary */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; display: flex; flex-direction: column; gap: 4px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 24px; font-weight: 700; }
.stat .progress { height: 6px; }

.gantt { position: relative; font-size: 13px; }
.gantt-row { display: flex; align-items: center; height: 26px; }
.gantt-label { width: var(--gantt-label); flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 10px; color: var(--muted); }
.gantt-track { position: relative; flex: 1; height: 100%; border-left: 1px solid var(--border); background: repeating-linear-gradient(90deg, transparent 0 calc(100% / 12 - 1px), var(--surface-2) calc(100% / 12 - 1px) calc(100% / 12)); }
.gantt-bar { position: absolute; top: 6px; height: 14px; border-radius: 4px; background: var(--stage); opacity: .55; }
.gantt-bar.progress { opacity: .85; outline: 2px solid var(--stage); }
.gantt-bar.done { opacity: 1; }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 2; }

.stage-title { font-size: 14px; font-weight: 600; margin: 18px 0 8px; display: flex; align-items: center; }
.task-list { list-style: none; padding: 0; margin: 0; }
.task { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: var(--surface); }
.task.done b { text-decoration: line-through; color: var(--muted); }
.task-main { display: flex; gap: 10px; align-items: flex-start; }
.status-btn { border: 0; background: none; font-size: 20px; line-height: 1; padding: 0; color: var(--muted); }
.status-btn.done { color: var(--ok); }
.status-btn.progress { color: #d08b1a; }
.task-notes { margin-top: 6px; font-size: 13px; background: #fff8e6; border-radius: 6px; padding: 6px 8px; }
.task-edit summary { cursor: pointer; font-size: 13px; color: var(--primary); margin-top: 6px; list-style: none; }
.task-form { margin-top: 8px; padding: 12px; background: var(--surface-2); border-radius: 8px; }

/* Gallery */
.stage-filter { display: flex; flex-direction: column; }
.stage-filter a { display: flex; align-items: center; padding: 6px 8px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.stage-filter a span:last-child { margin-left: auto; color: var(--muted); font-size: 12px; }
.stage-filter a.active, .stage-filter a:hover { background: var(--primary-soft); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.gallery-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 0; }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.gallery-item figcaption { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.gallery-item p { margin: 0; font-size: 13px; }
.validation-summary-valid { display: none; }
