/* themaERP — Identity UI (login + launcher)
   Sigue la línea gráfica del cotizador: navy + accent + Inter. */

:root {
    --navy: #1f3364;
    --navy-dark: #142244;
    --accent: #4372b8;
    --accent-light: #6ea4e8;
    --bg: #f4f6fa;
    --card: #ffffff;
    --border: #e1e6ef;
    --text: #1f2a44;
    --text-muted: #6b7689;
    --error: #c62828;
    --success: #2e7d32;
    --shadow: 0 8px 32px rgba(31, 51, 100, 0.08);
    --radius: 12px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; cursor: pointer; }

/* ─────────── LOGIN ─────────── */
.login-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
}
.login-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 420px;
    padding: 40px 36px;
}
.login-brand {
    text-align: center;
    margin-bottom: 28px;
}
.login-brand .logo {
    font-size: 32px;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -0.5px;
}
.login-brand .tag {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}
.login-form .field {
    margin-bottom: 18px;
}
.login-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.login-form input {
    width: 100%;
    padding: 11px 14px;
    font-size: 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafbfd;
    color: var(--text);
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.login-form input:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(67, 114, 184, 0.15);
}
.login-form .btn-primary {
    width: 100%;
    padding: 12px 18px;
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.15s, transform 0.05s;
    margin-top: 8px;
}
.login-form .btn-primary:hover { background: var(--navy-dark); }
.login-form .btn-primary:active { transform: scale(0.99); }
.login-form .btn-primary[disabled] { opacity: 0.6; cursor: wait; }

.message {
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
}
.message.error {
    background: #fdecea;
    color: var(--error);
    border-left: 3px solid var(--error);
    display: block;
}
.message.success {
    background: #e8f5e9;
    color: var(--success);
    border-left: 3px solid var(--success);
    display: block;
}

/* ─────────── LAUNCHER ─────────── */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.app-header {
    background: var(--navy);
    color: #fff;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 8px rgba(0,0,0,0.08);
}
.app-header .brand {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}
.app-header .user-info {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
}
.app-header .user-info .email { color: rgba(255,255,255,0.85); }
.app-header .btn-logout {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    transition: background 0.15s;
}
.app-header .btn-logout:hover { background: rgba(255,255,255,0.1); }

.launcher-main {
    flex: 1;
    padding: 40px 28px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}
.launcher-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 6px 0;
}
.launcher-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin: 0 0 32px 0;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}
.module-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}
.module-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--accent);
    text-decoration: none;
}
.module-card .icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--navy) 100%);
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 6px;
}
.module-card .name {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
}
.module-card .desc {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.4;
}
.module-card .role-tag {
    display: inline-block;
    background: #eef2fb;
    color: var(--accent);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 6px;
    width: fit-content;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state .icon {
    font-size: 56px;
    margin-bottom: 12px;
    color: var(--border);
}
