:root {
    --bg: #f4f5f7;
    --panel: #ffffff;
    --border: #e2e4e9;
    --text: #1f2430;
    --muted: #6b7280;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}

.topbar h1 { font-size: 18px; margin: 0; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.btn {
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #eef0f5; color: var(--text); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-sm { padding: 6px 10px; font-size: 13px; }

.muted { color: var(--muted); font-size: 13px; }

.board {
    display: flex;
    gap: 14px;
    padding: 18px;
    overflow-x: auto;
    align-items: flex-start;
}

.column {
    background: #eceef2;
    border-radius: var(--radius);
    min-width: 270px;
    max-width: 270px;
    flex: 0 0 270px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 90px);
}

.column-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    margin: 4px 6px 10px;
}

.count {
    background: #d7dae1;
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 12px;
}

.column-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    min-height: 40px;
    padding-bottom: 8px;
}

.column-body.drag-over {
    outline: 2px dashed var(--primary);
    outline-offset: -4px;
    border-radius: 8px;
}

.card {
    background: var(--panel);
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
    cursor: grab;
    border-left: 4px solid var(--muted);
}
.card[data-prioridad="alta"] { border-left-color: var(--warning); }
.card[data-prioridad="urgente"] { border-left-color: var(--danger); }
.card[data-prioridad="media"] { border-left-color: #6366f1; }
.card[data-prioridad="baja"] { border-left-color: #94a3b8; }

.card-title { font-size: 14px; margin: 0 0 6px; }
.card-area { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.card-foto-flag { display: none; }
.card-foto-flag.visible { display: inline; }
.card-asignados { margin-top: 6px; font-size: 12px; color: var(--primary); }

.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 17, 26, .5);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 40px 16px;
    overflow-y: auto;
}
.modal-overlay.hidden { display: none; }

.modal {
    background: var(--panel);
    border-radius: var(--radius);
    padding: 20px;
    width: 100%;
    max-width: 560px;
}

.modal h2 { margin-top: 0; }
.modal label { display: block; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.modal input[type=text], .modal input[type=date], .modal textarea, .modal select {
    width: 100%; padding: 8px; border-radius: 6px; border: 1px solid var(--border);
    font-size: 14px; margin-top: 4px;
}
.modal textarea { min-height: 70px; resize: vertical; }

.checklist-item { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 4px; }
.comment { border-bottom: 1px solid var(--border); padding: 6px 0; font-size: 13px; }
.comment .comment-meta { color: var(--muted); font-size: 11px; }
.comment.voz .comment-meta::after { content: " · dictado por voz"; }

.attachment-thumb { max-width: 120px; border-radius: 6px; margin: 4px 4px 0 0; }

.alert { padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 10px; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-success { background: #dcfce7; color: #166534; }

.login-body { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-card { background: var(--panel); padding: 30px; border-radius: var(--radius); width: 320px; box-shadow: 0 4px 20px rgba(0,0,0,.08); }
.login-card label { display: block; margin: 10px 0; font-size: 13px; }
.login-card input { width: 100%; padding: 8px; margin-top: 4px; border-radius: 6px; border: 1px solid var(--border); }
.login-card button { width: 100%; margin-top: 12px; }

.admin-panel { padding: 20px; display: flex; flex-direction: column; gap: 20px; max-width: 900px; margin: 0 auto; }
.panel { background: var(--panel); border-radius: var(--radius); padding: 18px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.form-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; font-size: 13px; }
.form-inline input[type=text], .form-inline input[type=number] { padding: 6px; border-radius: 6px; border: 1px solid var(--border); }

.voice-btn {
    background: #eef0f5; border: none; border-radius: 999px; width: 34px; height: 34px;
    cursor: pointer; font-size: 16px;
}
.voice-btn.recording { background: var(--danger); color: #fff; }
