/* ============================================================
   CRM Servicios — Design System
   Paleta y tipografía alineadas al portal AllToken (Blotix)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Superficies */
    --bg-app: #F4F5FA;
    --bg-sidebar: #15162B;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.06);
    --bg-sidebar-active: rgba(109, 93, 251, 0.18);
    --card-bg: #FFFFFF;
    --card-border: #ECEDF3;

    /* Marca / acento */
    --accent: #6D5DFB;
    --accent-dark: #5947E6;
    --accent-soft: #EEEBFF;
    --accent-gradient: linear-gradient(135deg, #7C6FF5 0%, #5947E6 100%);

    /* Texto */
    --text-primary: #191A2B;
    --text-secondary: #6B7089;
    --text-muted: #9C9FB5;
    --text-on-dark: #E7E7F3;
    --text-on-dark-muted: #8B8DA8;

    /* Estados */
    --success: #17A362;
    --success-bg: #E5F8EE;
    --warning: #E29B0E;
    --warning-bg: #FDF3DC;
    --danger: #E5484D;
    --danger-bg: #FDE9E9;
    --info: #3B82F6;
    --info-bg: #E9F0FE;

    /* Forma */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-card: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .05);
    --shadow-modal: 0 12px 40px rgba(16, 24, 40, .18);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-app);
    color: var(--text-primary);
    font-size: 14.5px;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }

/* ---------- Layout con sidebar ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--bg-sidebar);
    color: var(--text-on-dark);
    display: flex;
    flex-direction: column;
    padding: 22px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 22px;
}

.sidebar-brand .logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(109, 93, 251, .35);
}

.sidebar-brand .logo-text {
    font-weight: 800;
    font-size: 16px;
    line-height: 1.1;
    color: #fff;
}

.sidebar-brand .logo-text span { color: #A79BFF; }

.sidebar-brand .logo-sub {
    font-size: 10px;
    letter-spacing: .06em;
    color: var(--text-on-dark-muted);
    text-transform: uppercase;
    margin-top: 2px;
}

.sidebar-section-label {
    font-size: 10.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-on-dark-muted);
    padding: 16px 12px 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-on-dark);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 2px;
    transition: background .12s ease;
}

.sidebar-link:hover { background: var(--bg-sidebar-hover); color: #fff; }

.sidebar-link.active {
    background: var(--bg-sidebar-active);
    color: #fff;
    font-weight: 600;
}

.sidebar-link .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .5; }

.sidebar-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 8px 4px;
    border-top: 1px solid rgba(255, 255, 255, .07);
}

.sidebar-footer .avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12.5px; flex-shrink: 0;
}

.sidebar-footer .who { line-height: 1.2; overflow: hidden; }
.sidebar-footer .who .name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer .who .role { font-size: 11px; color: var(--text-on-dark-muted); }
.sidebar-footer .logout { margin-left: auto; color: var(--text-on-dark-muted); }
.sidebar-footer .logout:hover { color: #fff; }

/* ---------- Contenido principal ---------- */
.main-content {
    flex: 1;
    min-width: 0;
    padding: 26px 32px 40px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 22px;
}

.page-title { font-size: 21px; font-weight: 700; margin: 0; }
.page-breadcrumb { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.role-pill {
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
}

/* ---------- Tarjetas / cards ---------- */
.card-soft {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.stat-icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}

.stat-value { font-size: 22px; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }

/* ---------- Botones ---------- */
.btn-brand {
    background: var(--accent);
    border: none;
    color: #fff;
    font-weight: 600;
    font-size: 13.5px;
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    transition: background .12s ease;
}
.btn-brand:hover { background: var(--accent-dark); color: #fff; }

.btn-ghost {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 13px;
    border-radius: var(--radius-sm);
    padding: 7px 13px;
}
.btn-ghost:hover { background: #F7F7FB; }

/* ---------- Badges ---------- */
.badge-soft {
    font-size: 11.5px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    display: inline-block;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--info-bg);    color: var(--info); }

/* ---------- Kanban ---------- */
.kanban-board { padding-bottom: 10px; }

.kanban-columna { width: 300px; }

.kanban-columna-header {
    padding: 10px 14px;
    border-radius: var(--radius) var(--radius) 0 0;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kanban-columna-header .badge-count {
    background: rgba(255, 255, 255, .25);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 999px;
}

.kanban-columna-body {
    background: #F7F7FC;
    border: 1px solid var(--card-border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 10px;
    min-height: 420px;
}

.kanban-tarjeta {
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 12px 13px;
    margin-bottom: 10px;
    cursor: grab;
    transition: box-shadow .12s ease, transform .12s ease;
}
.kanban-tarjeta:hover { box-shadow: 0 6px 18px rgba(16,24,40,.10); }
.kanban-tarjeta.sortable-ghost { opacity: .4; }

.kanban-tarjeta-top { display: flex; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.kanban-tarjeta-titulo { font-weight: 600; font-size: 13.5px; margin-bottom: 3px; }
.kanban-tarjeta-meta { font-size: 12px; color: var(--text-secondary); }
.kanban-tarjeta-tecnico { font-size: 12px; color: var(--accent-dark); font-weight: 600; margin-top: 6px; }
.kanban-tarjeta-sinasignar { font-size: 12px; color: var(--danger); font-weight: 600; margin-top: 6px; }

/* ---------- Login ---------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 20%, #23204A 0%, #0F0F1E 55%, #0B0B16 100%);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--radius-lg);
    padding: 32px 30px 26px;
    backdrop-filter: blur(6px);
}

.login-card .logo-mark {
    width: 40px; height: 40px; border-radius: 11px;
    background: var(--accent-gradient);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px rgba(109, 93, 251, .4);
    margin-bottom: 14px;
}

.login-card h1 {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    margin: 0;
}
.login-card .brand-sub {
    font-size: 10px;
    letter-spacing: .07em;
    color: #8B8DA8;
    text-transform: uppercase;
}

.login-card h2 { color: #fff; font-size: 21px; font-weight: 700; margin: 18px 0 2px; }
.login-card .login-hint { color: #9496AF; font-size: 13px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,.08); }

.login-card label {
    font-size: 11px;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #9496AF;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}

.login-card .form-control {
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 13.5px;
}
.login-card .form-control:focus {
    background: rgba(255, 255, 255, .08);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(109, 93, 251, .25);
}
.login-card .form-control::placeholder { color: #6D6F8A; }

.login-card .btn-brand { width: 100%; padding: 11px; font-size: 14px; margin-top: 6px; }

.login-footer {
    text-align: center;
    font-size: 11.5px;
    color: #6D6F8A;
    margin-top: 20px;
}
.login-footer strong { color: #A79BFF; }

/* ---------- Tablas ---------- */
.table-clean thead th {
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--card-border);
    padding: 10px 14px;
}
.table-clean tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--card-border);
    font-size: 13.5px;
    vertical-align: middle;
}
.table-clean tbody tr:last-child td { border-bottom: none; }

.avatar-initials {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; flex-shrink: 0;
}
