/* kreisa-dashboard — stile principale */
:root {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-hover: #334155;
    --border: #334155;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --green: #22c55e;
    --yellow: #eab308;
    --red: #ef4444;
    --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
}
.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}
.header h1 span { color: var(--accent); }
.header-actions { display: flex; gap: 0.75rem; align-items: center; }

/* Filtri */
.filters {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 2rem;
    flex-wrap: wrap;
    align-items: center;
}
.filters select, .filters input {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}
.filters select:focus, .filters input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Griglia progetti */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
    padding: 1rem 2rem 2rem;
}

/* Card progetto */
.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: border-color 0.2s, transform 0.15s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.project-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.project-card .card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}
.project-card .card-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.project-card .card-meta .os-icon { font-size: 1rem; }
.project-card .card-path {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    word-break: break-all;
}
.project-card .card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.project-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

/* Badge stato */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-active   { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-paused   { background: rgba(234,179,8,0.15); color: var(--yellow); }
.badge-completed { background: rgba(148,163,184,0.15); color: var(--text-muted); }

/* Session time */
.session-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.session-time.active-now {
    color: var(--green);
    font-weight: 600;
}

/* Bottoni */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}
.btn-primary {
    background: var(--accent);
    color: white;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
    background: var(--surface-hover);
    color: var(--text);
}
.btn-secondary:hover { background: var(--border); }
.btn-terminal {
    background: rgba(34,197,94,0.15);
    color: var(--green);
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
}
.btn-terminal:hover { background: rgba(34,197,94,0.25); }
.btn-delete {
    background: rgba(239,68,68,0.15);
    color: var(--red);
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
}
.btn-delete:hover { background: rgba(239,68,68,0.25); }

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 100;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    width: 90%;
    max-width: 500px;
}
.modal h2 { margin-bottom: 1.25rem; font-size: 1.2rem; }
.modal label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.modal input, .modal select, .modal textarea {
    width: 100%;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.modal textarea { resize: vertical; min-height: 80px; }
.modal input:focus, .modal select:focus, .modal textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* Dettaglio progetto */
.project-detail { padding: 2rem; max-width: 900px; margin: 0 auto; }
.project-detail .detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}
.project-detail h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }
.detail-info { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 2rem; }
.detail-info .info-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}
.detail-info .info-box label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.detail-info .info-box p { margin-top: 0.25rem; font-size: 0.95rem; }

/* Form aggiornamento progetto */
.update-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.update-form h3 { margin-bottom: 1rem; }
.update-form label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.update-form input, .update-form select, .update-form textarea {
    width: 100%;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.update-form textarea { resize: vertical; min-height: 100px; }

/* Timeline sessioni */
.sessions-list { margin-top: 1rem; }
.sessions-list h3 { margin-bottom: 1rem; }
.session-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.session-item .session-date { font-weight: 500; }
.session-item .session-duration {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}
.empty-state p { font-size: 1.1rem; margin-bottom: 1rem; }

/* Responsive */
@media (max-width: 768px) {
    .header { padding: 1rem; flex-wrap: wrap; gap: 0.75rem; }
    .filters { padding: 0.75rem 1rem; }
    .projects-grid { padding: 0.75rem 1rem; grid-template-columns: 1fr; }
    .project-detail { padding: 1rem; }
    .detail-info { grid-template-columns: 1fr; }
}
