// Vildez i18n - simple key/value lookup
const I18N = {
  en: {
    // nav
    "general": "GENERAL",
    "workspace": "WORKSPACE",
    "infra": "INFRASTRUCTURE",
    "admin": "ADMIN",
    "dashboard": "Dashboard",
    "fiscal": "Fiscal",
    "invoices": "Invoices",
    "clients": "Clients",
    "accounting": "Accounting",
    "journal_book": "Journal",
    "ledger_book": "General Ledger",
    "chart_of_accounts": "Chart of accounts",
    "coming_soon_title": "Coming soon",
    "coming_soon_sub": "This module needs country-specific configuration before it can be used.",
    "activity_empty": "No activity yet.",
    "system": "System",
    "act.client.created":      "added client",
    "act.client.archived":     "archived client",
    "act.client.unarchived":   "restored client",
    "act.account.created":     "created account",
    "act.journal_entry.created": "posted journal entry",
    "act.invoice.created":     "issued invoice",
    "act.invoice.updated":     "updated invoice",
    "act.invoice.archived":    "archived invoice",
    "act.company.created":     "created company",
    "act.team.created":        "created team",
    "act.team.member_added":   "added member",
    "act.team.member_removed": "removed member",
    "act.alert.created":       "raised alert",
    "act.auth.login":          "logged in",
    "act.auth.logout":         "logged out",
    "act.auth.login_failed":   "failed to log in",
    "act.board.created":         "created board",
    "act.board.updated":         "updated board",
    "act.board.deleted":         "deleted board",
    "act.boardstate.created":    "added column",
    "act.boardstate.updated":    "updated column",
    "act.boardstate.deleted":    "deleted column",
    "act.boardstate.reordered":  "reordered columns",
    "act.sprint.created":        "started sprint",
    "act.sprint.updated":        "updated sprint",
    "act.sprint.deleted":        "deleted sprint",
    "act.story.created":         "created user story",
    "act.story.updated":         "updated user story",
    "act.story.deleted":         "deleted user story",
    "act.workitem.created":      "created work item",
    "act.workitem.updated":      "updated work item",
    "act.workitem.deleted":      "deleted work item",
    "act.workitem.moved":        "moved work item",
    "companies": "My Companies",
    "alerts": "Alerts",
    "docs": "Docs",
    "drive": "Storage",
    "tasks": "Tasks",
    "automations": "Automations",
    "chat": "Comms",
    "social": "Social",
    "servers": "Servers",
    "users": "Team",
    "settings": "Settings",
    "profile": "Profile",
    // header
    "search_ph": "Search across Vildez…",
    // dashboard
    "good_morning": "Good morning",
    "good_afternoon": "Good afternoon",
    "good_evening": "Good evening",
    "dash_subtitle": "Here's what's happening across your business today.",
    "billed": "Billed this month",
    "total_invoices": "Total invoices",
    "active_companies": "Active companies",
    "active_clients": "Active clients",
    "pending_amount": "Pending amount",
    "vs_last": "vs last month",
    "recent_invoices": "Recent invoices",
    "view_all": "View all",
    "your_modules": "Your modules",
    "quick_actions": "Quick actions",
    "new_invoice": "New invoice",
    "new_client": "New client",
    "edit_client": "Edit client",
    "edit_member": "Edit member",
    "save": "Save",
    "cancel": "Cancel",
    "amount_range": "Amount range",
    "clear_filters": "Clear filters",
    "new_doc": "New doc",
    "upload_file": "Upload file",
    "activity": "Activity",
    "soon": "Soon",
    // invoices
    "invoices_title": "Invoices",
    "invoices_sub": "Manage and issue invoices to your clients.",
    "new": "New",
    "export": "Export",
    "filter": "Filter",
    "number": "Number",
    "date": "Date",
    "issuer": "Issuer",
    "client": "Client",
    "status": "Status",
    "total": "Total",
    "all": "All",
    "paid": "Paid",
    "pending": "Pending",
    "overdue": "Overdue",
    "draft": "Draft",
    "active": "Active",
    "archived": "Archived",
    "no_invoices": "No invoices match this filter.",
    "no_templates": "No templates yet. Create one from any invoice.",
    "no_clients": "No clients to show.",
    "no_alerts": "Nothing here.",
    // clients
    "clients_title": "Clients",
    "clients_sub": "People and companies you bill to.",
    "name": "Name",
    "email": "Email",
    "phone": "Phone",
    "country": "Country",
    "invoices_count": "Invoices",
    // companies
    "companies_title": "My Companies",
    "companies_sub": "Legal entities you issue invoices from.",
    // alerts
    "alerts_title": "Alerts",
    "alerts_sub": "Notifications and reminders generated from your data.",
    "unread": "Unread",
    "read": "Read",
    "mark_read": "Mark all read",
    // profile
    "profile_title": "Profile",
    "profile_sub": "Manage your account, security and preferences.",
    "personal": "Personal",
    "team": "Team",
    "notifications": "Notifications",
    "integrations": "Integrations",
    "billing": "Billing",
    "api_keys": "API keys",
    "security": "Security",
    "save_changes": "Save changes",
    // settings
    "settings_title": "Settings",
    "settings_sub": "Workspace preferences and configuration.",
    "appearance": "Appearance",
    "language": "Language",
    "theme": "Theme",
    "density": "Density",
    "light": "Light",
    "dark": "Dark",
    "comfortable": "Comfortable",
    "compact": "Compact",
    // onboarding
    "welcome": "Welcome to Vildez",
    "onb_sub": "The all-in-one platform for startups. Let's set up your workspace in under a minute.",
    "continue": "Continue",
    "back": "Back",
    "skip": "Skip for now",
    "finish": "Take me in",
    "step_company": "Your company",
    "step_modules": "Pick your modules",
    "step_team": "Invite your team",
    // common
    "coming_soon": "Coming soon",
    "soon_desc": "We're crafting this module. You'll be the first to know when it's ready.",
    "notify_me": "Notify me",
    "preview": "Preview",
    "learn_more": "Learn more",
    "new_module": "New module",
    "cookies_settings": "Cookies",
    "cookies_settings_tooltip": "Cookie preferences",
    // tasks module — boards, sprints, stories, work items
    "tasks_title": "Tasks",
    "tasks_sub": "Boards, sprints, stories and the work that ships them.",
    "boards": "Boards",
    "board": "Board",
    "sprint": "Sprint",
    "sprints": "Sprints",
    "user_story": "User story",
    "user_stories": "User stories",
    "task": "Task",
    "bug": "Bug",
    "tasks_short": "Tasks",
    "bugs": "Bugs",
    "no_boards": "No boards yet.",
    "no_boards_sub": "Create your first board to plan a sprint with stories, tasks and bugs.",
    "no_sprints": "No sprints yet on this board.",
    "no_stories_sprint": "No stories in this sprint.",
    "no_stories_backlog": "Backlog is empty.",
    "new_board": "New board",
    "new_sprint": "New sprint",
    "new_story": "New story",
    "new_task": "New task",
    "new_bug": "New bug",
    "edit_board": "Edit board",
    "edit_sprint": "Edit sprint",
    "edit_story": "Edit story",
    "edit_item": "Edit work item",
    "delete_board_confirm": "Delete this board and everything inside?",
    "delete_sprint_confirm": "Delete this sprint? Its stories will move to the backlog.",
    "delete_story_confirm": "Delete this story and its tasks/bugs?",
    "delete_item_confirm": "Delete this work item?",
    "board_settings": "Board settings",
    "manage_states": "Columns",
    "add_state": "Add column",
    "delete_state": "Delete column",
    "rename_state": "Rename column",
    "reassign_items_to": "Reassign items to",
    "delete_state_has_items": "This column has work items. Choose where to move them before deleting.",
    "is_initial": "Initial",
    "is_terminal": "Done",
    "assignee": "Assignee",
    "unassigned": "Unassigned",
    "goal": "Goal",
    "start_date": "Start date",
    "end_date": "End date",
    "title": "Title",
    "description": "Description",
    "type": "Type",
    "active_now": "Active",
    "backlog": "Backlog",
    "select_board": "Select board",
    "select_sprint": "Sprint",
    "view_backlog": "Backlog",
    "drop_invalid_story": "Tasks must stay inside their story",
    "delete": "Delete",
    "confirm": "Confirm",
    "create": "Create",
    // docs module — Notion-like pages
    "docs_title": "Docs",
    "docs_sub": "Block-based pages, like Notion.",
    "docs_new_page": "New page",
    "docs_new_subpage": "Add subpage",
    "docs_untitled": "Untitled",
    "docs_no_pages": "No pages yet.",
    "docs_no_pages_sub": "Create your first page to start writing.",
    "docs_pick_page": "Select a page from the tree, or create one.",
    "docs_title_placeholder": "Untitled",
    "docs_block_placeholder": "Type '/' for commands, or just start writing…",
    "docs_block_empty_placeholder": "Press '/' for commands…",
    "docs_change_icon": "Change icon",
    "docs_remove_icon": "Remove icon",
    "docs_icon_prompt": "Pick an emoji (leave empty to remove):",
    "docs_rename": "Rename",
    "docs_send_to_trash": "Move to trash",
    "docs_restore": "Restore",
    "docs_delete_forever": "Delete permanently",
    "docs_delete_forever_confirm": "Permanently delete this page? This cannot be undone.",
    "docs_trash_empty": "Trash is empty.",
    "docs_trash_empty_sub": "Pages you delete appear here.",
    "docs_saving": "Saving…",
    "docs_saved": "Saved",
    "docs_save_failed": "Save failed",
    "docs_section_shared": "Shared with me",
    "docs_section_templates": "Templates",
    "docs_section_soon": "Coming soon.",
    // slash menu
    "blk_text": "Text",
    "blk_text_desc": "Plain paragraph.",
    "blk_h1": "Heading 1",
    "blk_h1_desc": "Big section heading.",
    "blk_h2": "Heading 2",
    "blk_h2_desc": "Medium section heading.",
    "blk_h3": "Heading 3",
    "blk_h3_desc": "Small section heading.",
    "blk_bullet": "Bulleted list",
    "blk_bullet_desc": "An unordered list.",
    "blk_numbered": "Numbered list",
    "blk_numbered_desc": "An ordered list.",
    "blk_todo": "To-do",
    "blk_todo_desc": "A task with a checkbox.",
    "blk_quote": "Quote",
    "blk_quote_desc": "Capture a quote.",
    "blk_code": "Code",
    "blk_code_desc": "A monospaced code block.",
    "blk_divider": "Divider",
    "blk_divider_desc": "A horizontal line.",
    "act.page.created":   "created page",
    "act.page.renamed":   "renamed page",
    "act.page.moved":     "moved page",
    "act.page.updated":   "updated page",
    "act.page.trashed":   "moved page to trash",
    "act.page.restored":  "restored page",
    "act.page.deleted":   "deleted page"
  },
  es: {
    "general": "GENERAL",
    "workspace": "ESPACIO DE TRABAJO",
    "infra": "INFRAESTRUCTURA",
    "admin": "ADMINISTRACIÓN",
    "dashboard": "Dashboard",
    "fiscal": "Fiscal",
    "invoices": "Facturas",
    "clients": "Clientes",
    "accounting": "Contabilidad",
    "journal_book": "Libro Diario",
    "ledger_book": "Libro Mayor",
    "chart_of_accounts": "Plan de cuentas",
    "coming_soon_title": "Próximamente",
    "coming_soon_sub": "Este módulo necesita configuración específica por país antes de poder usarse.",
    "activity_empty": "Sin actividad aún.",
    "system": "Sistema",
    "act.client.created":      "añadió el cliente",
    "act.client.archived":     "archivó el cliente",
    "act.client.unarchived":   "restauró el cliente",
    "act.account.created":     "creó la cuenta",
    "act.journal_entry.created": "registró el asiento",
    "act.invoice.created":     "emitió la factura",
    "act.invoice.updated":     "actualizó la factura",
    "act.invoice.archived":    "archivó la factura",
    "act.company.created":     "creó la empresa",
    "act.team.created":        "creó el equipo",
    "act.team.member_added":   "añadió al miembro",
    "act.team.member_removed": "eliminó al miembro",
    "act.alert.created":       "generó alerta",
    "act.auth.login":          "inició sesión",
    "act.auth.logout":         "cerró sesión",
    "act.auth.login_failed":   "intento fallido de login",
    "act.board.created":         "creó el tablero",
    "act.board.updated":         "actualizó el tablero",
    "act.board.deleted":         "eliminó el tablero",
    "act.boardstate.created":    "añadió columna",
    "act.boardstate.updated":    "actualizó columna",
    "act.boardstate.deleted":    "eliminó columna",
    "act.boardstate.reordered":  "reordenó columnas",
    "act.sprint.created":        "creó el sprint",
    "act.sprint.updated":        "actualizó el sprint",
    "act.sprint.deleted":        "eliminó el sprint",
    "act.story.created":         "creó la user story",
    "act.story.updated":         "actualizó la user story",
    "act.story.deleted":         "eliminó la user story",
    "act.workitem.created":      "creó tarea",
    "act.workitem.updated":      "actualizó tarea",
    "act.workitem.deleted":      "eliminó tarea",
    "act.workitem.moved":        "movió tarea",
    "companies": "Mis Empresas",
    "alerts": "Alertas",
    "docs": "Documentación",
    "drive": "Almacenamiento",
    "tasks": "Tareas",
    "automations": "Automatizaciones",
    "chat": "Comunicación",
    "social": "RRSS",
    "servers": "Servidores",
    "users": "Equipo",
    "settings": "Ajustes",
    "profile": "Perfil",
    "search_ph": "Buscar en Vildez…",
    "good_morning": "Buenos días",
    "good_afternoon": "Buenas tardes",
    "good_evening": "Buenas noches",
    "dash_subtitle": "Esto es lo que está pasando hoy en tu negocio.",
    "billed": "Facturado este mes",
    "total_invoices": "Facturas totales",
    "active_companies": "Empresas activas",
    "active_clients": "Clientes activos",
    "pending_amount": "Importe pendiente",
    "vs_last": "vs. mes anterior",
    "recent_invoices": "Últimas facturas",
    "view_all": "Ver todas",
    "your_modules": "Tus módulos",
    "quick_actions": "Acciones rápidas",
    "new_invoice": "Nueva factura",
    "new_client": "Nuevo cliente",
    "edit_client": "Editar cliente",
    "edit_member": "Editar miembro",
    "save": "Guardar",
    "cancel": "Cancelar",
    "amount_range": "Importe",
    "clear_filters": "Limpiar filtros",
    "new_doc": "Nuevo documento",
    "upload_file": "Subir archivo",
    "activity": "Actividad",
    "soon": "Próximo",
    "invoices_title": "Facturas",
    "invoices_sub": "Gestiona y emite facturas a tus clientes.",
    "new": "Nueva",
    "export": "Exportar",
    "filter": "Filtrar",
    "number": "Número",
    "date": "Fecha",
    "issuer": "Emisor",
    "client": "Cliente",
    "status": "Estado",
    "total": "Total",
    "all": "Todas",
    "paid": "Pagada",
    "pending": "Pendiente",
    "overdue": "Vencida",
    "draft": "Borrador",
    "active": "Activos",
    "archived": "Archivados",
    "no_invoices": "Ninguna factura coincide con el filtro.",
    "no_templates": "Aún no hay plantillas. Crea una desde cualquier factura.",
    "no_clients": "No hay clientes que mostrar.",
    "no_alerts": "Aquí no hay nada.",
    "clients_title": "Clientes",
    "clients_sub": "Personas y empresas a las que facturas.",
    "name": "Nombre",
    "email": "Email",
    "phone": "Teléfono",
    "country": "País",
    "invoices_count": "Facturas",
    "companies_title": "Mis Empresas",
    "companies_sub": "Entidades legales desde las que emites facturas.",
    "alerts_title": "Alertas",
    "alerts_sub": "Notificaciones y recordatorios generados desde tus datos.",
    "unread": "Sin leer",
    "read": "Leídas",
    "mark_read": "Marcar todo como leído",
    "profile_title": "Perfil",
    "profile_sub": "Gestiona tu cuenta, seguridad y preferencias.",
    "personal": "Personal",
    "team": "Equipo",
    "notifications": "Notificaciones",
    "integrations": "Integraciones",
    "billing": "Facturación",
    "api_keys": "API keys",
    "security": "Seguridad",
    "save_changes": "Guardar cambios",
    "settings_title": "Ajustes",
    "settings_sub": "Preferencias y configuración del espacio.",
    "appearance": "Apariencia",
    "language": "Idioma",
    "theme": "Tema",
    "density": "Densidad",
    "light": "Claro",
    "dark": "Oscuro",
    "comfortable": "Cómoda",
    "compact": "Compacta",
    "welcome": "Bienvenido a Vildez",
    "onb_sub": "La plataforma todo en uno para startups. Configura tu espacio en menos de un minuto.",
    "continue": "Continuar",
    "back": "Atrás",
    "skip": "Saltar por ahora",
    "finish": "Empezar",
    "step_company": "Tu empresa",
    "step_modules": "Elige tus módulos",
    "step_team": "Invita a tu equipo",
    "coming_soon": "Próximamente",
    "soon_desc": "Estamos creando este módulo. Te avisaremos cuando esté listo.",
    "notify_me": "Avísame",
    "preview": "Vista previa",
    "learn_more": "Saber más",
    "new_module": "Nuevo módulo",
    "cookies_settings": "Cookies",
    "cookies_settings_tooltip": "Preferencias de cookies",
    // tasks module — boards, sprints, stories, work items
    "tasks_title": "Tareas",
    "tasks_sub": "Tableros, sprints, historias y el trabajo que las saca.",
    "boards": "Tableros",
    "board": "Tablero",
    "sprint": "Sprint",
    "sprints": "Sprints",
    "user_story": "User story",
    "user_stories": "User stories",
    "task": "Tarea",
    "bug": "Bug",
    "tasks_short": "Tareas",
    "bugs": "Bugs",
    "no_boards": "Aún no hay tableros.",
    "no_boards_sub": "Crea tu primer tablero para planificar un sprint con stories, tareas y bugs.",
    "no_sprints": "Este tablero no tiene sprints.",
    "no_stories_sprint": "No hay stories en este sprint.",
    "no_stories_backlog": "El backlog está vacío.",
    "new_board": "Nuevo tablero",
    "new_sprint": "Nuevo sprint",
    "new_story": "Nueva story",
    "new_task": "Nueva tarea",
    "new_bug": "Nuevo bug",
    "edit_board": "Editar tablero",
    "edit_sprint": "Editar sprint",
    "edit_story": "Editar story",
    "edit_item": "Editar item",
    "delete_board_confirm": "¿Eliminar este tablero y todo su contenido?",
    "delete_sprint_confirm": "¿Eliminar este sprint? Sus stories pasarán al backlog.",
    "delete_story_confirm": "¿Eliminar esta story y sus tareas/bugs?",
    "delete_item_confirm": "¿Eliminar este item?",
    "board_settings": "Ajustes del tablero",
    "manage_states": "Columnas",
    "add_state": "Añadir columna",
    "delete_state": "Eliminar columna",
    "rename_state": "Renombrar columna",
    "reassign_items_to": "Mover items a",
    "delete_state_has_items": "Esta columna tiene items. Elige a qué columna moverlos antes de eliminarla.",
    "is_initial": "Inicial",
    "is_terminal": "Hecho",
    "assignee": "Asignado a",
    "unassigned": "Sin asignar",
    "goal": "Objetivo",
    "start_date": "Inicio",
    "end_date": "Fin",
    "title": "Título",
    "description": "Descripción",
    "type": "Tipo",
    "active_now": "Activo",
    "backlog": "Backlog",
    "select_board": "Selecciona tablero",
    "select_sprint": "Sprint",
    "view_backlog": "Backlog",
    "drop_invalid_story": "Las tareas deben permanecer dentro de su story",
    "delete": "Eliminar",
    "confirm": "Confirmar",
    "create": "Crear",
    // docs module — páginas estilo Notion
    "docs_title": "Documentación",
    "docs_sub": "Páginas por bloques, estilo Notion.",
    "docs_new_page": "Nueva página",
    "docs_new_subpage": "Añadir subpágina",
    "docs_untitled": "Sin título",
    "docs_no_pages": "Aún no hay páginas.",
    "docs_no_pages_sub": "Crea tu primera página para empezar a escribir.",
    "docs_pick_page": "Selecciona una página del árbol o crea una nueva.",
    "docs_title_placeholder": "Sin título",
    "docs_block_placeholder": "Escribe '/' para comandos o empieza a escribir…",
    "docs_block_empty_placeholder": "Pulsa '/' para comandos…",
    "docs_change_icon": "Cambiar icono",
    "docs_remove_icon": "Quitar icono",
    "docs_icon_prompt": "Elige un emoji (vacío para quitar):",
    "docs_rename": "Renombrar",
    "docs_send_to_trash": "Mover a la papelera",
    "docs_restore": "Restaurar",
    "docs_delete_forever": "Eliminar permanentemente",
    "docs_delete_forever_confirm": "¿Eliminar esta página permanentemente? Esta acción no se puede deshacer.",
    "docs_trash_empty": "La papelera está vacía.",
    "docs_trash_empty_sub": "Las páginas que elimines aparecerán aquí.",
    "docs_saving": "Guardando…",
    "docs_saved": "Guardado",
    "docs_save_failed": "Error al guardar",
    "docs_section_shared": "Compartido conmigo",
    "docs_section_templates": "Plantillas",
    "docs_section_soon": "Próximamente.",
    "blk_text": "Texto",
    "blk_text_desc": "Párrafo simple.",
    "blk_h1": "Encabezado 1",
    "blk_h1_desc": "Encabezado de sección grande.",
    "blk_h2": "Encabezado 2",
    "blk_h2_desc": "Encabezado de sección mediano.",
    "blk_h3": "Encabezado 3",
    "blk_h3_desc": "Encabezado de sección pequeño.",
    "blk_bullet": "Lista con viñetas",
    "blk_bullet_desc": "Lista no ordenada.",
    "blk_numbered": "Lista numerada",
    "blk_numbered_desc": "Lista ordenada.",
    "blk_todo": "Tarea",
    "blk_todo_desc": "Una tarea con casilla.",
    "blk_quote": "Cita",
    "blk_quote_desc": "Captura una cita.",
    "blk_code": "Código",
    "blk_code_desc": "Bloque de código monoespaciado.",
    "blk_divider": "Separador",
    "blk_divider_desc": "Línea horizontal.",
    "act.page.created":   "creó la página",
    "act.page.renamed":   "renombró la página",
    "act.page.moved":     "movió la página",
    "act.page.updated":   "actualizó la página",
    "act.page.trashed":   "envió la página a la papelera",
    "act.page.restored":  "restauró la página",
    "act.page.deleted":   "eliminó la página"
  }
};

window.useT = function useT(lang) {
  return React.useCallback((key) => {
    const dict = I18N[lang] || I18N.en;
    return dict[key] || I18N.en[key] || key;
  }, [lang]);
};

window.I18N = I18N;
