/* =============================================================================
   Jobs for Samuel — hoja de estilo única (puerto del diseño Atera de la app
   Next: mismos valores oklch, mismas medidas). Escrita a mano, sin build.

   Orden: variables · base · chasis · cabecera · superficies · tablas ·
   formularios · botones · estado (pills, notas, chips) · vacíos · listas ·
   tiles · tablero · toast · login · impresión.
   ========================================================================== */

:root {
    --bg: oklch(0.971 0.003 265);
    --fg: oklch(0.215 0.02 265);
    --card: #fff;
    --border: oklch(0.912 0.005 265);
    --input: oklch(0.892 0.006 265);
    --muted: oklch(0.962 0.005 265);
    --muted-fg: oklch(0.53 0.02 265);
    --primary: oklch(0.58 0.245 355);
    --primary-fg: oklch(0.99 0 0);
    --sidebar: oklch(0.255 0.032 265);
    --sidebar-fg: oklch(0.93 0.01 265);
    --sidebar-hover: oklch(0.33 0.032 265);
    --destructive: oklch(0.577 0.245 27.325);
    --radius: 0.5rem;
    --shadow: 0 1px 2px rgb(15 23 42 / 6%);
    --shadow-lg: 0 8px 24px rgb(15 23 42 / 12%);
}

/* --- base ---------------------------------------------------------------- */

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: system-ui, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, figure {
    margin: 0;
}

h1, h2, h3 {
    line-height: 1.25;
}

a {
    color: inherit;
}

img, svg {
    max-width: 100%;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.muted { color: var(--muted-fg); }
.small { font-size: 0.75rem; }
.num { font-variant-numeric: tabular-nums; }
.link { color: var(--primary); text-decoration: none; font-weight: 500; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

.truncate {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.stack { display: grid; gap: 0.75rem; }

.grid-2 {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 1280px) {
    .grid-2 { grid-template-columns: 1fr 22rem; }
}

/* Bloques plegables: compositor de correo, consejos del CV. */
summary {
    cursor: pointer;
    font-weight: 500;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* --- chasis: barra lateral + lienzo -------------------------------------- */

.sidebar {
    display: flex;
    flex-direction: column;
    background: var(--sidebar);
    color: var(--sidebar-fg);
}

.main { min-width: 0; }

@media (min-width: 768px) {
    .app { display: flex; }
    .main { flex: 1; }

    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        width: 15rem;
        flex-shrink: 0;
    }
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1rem 1.25rem;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border-radius: 0.375rem;
    background: var(--primary);
    color: var(--primary-fg);
    font-weight: 700;
}

.brand-text {
    font-weight: 600;
    line-height: 1.25;
}

.brand-text span {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.6;
}

/* En móvil el menú es una fila con scroll horizontal; sin JS, solo flex. */
.nav {
    display: flex;
    gap: 0.25rem;
    list-style: none;
    padding: 0 0.75rem 0.75rem;
    overflow-x: auto;
}

@media (min-width: 768px) {
    .nav { flex-direction: column; overflow: visible; }
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s, color 0.15s;
}

.nav-link svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.nav-link:hover { background: var(--sidebar-hover); }

.nav-link.is-active {
    background: var(--primary);
    color: var(--primary-fg);
    font-weight: 500;
}

.nav-badge {
    margin-left: auto;
    border-radius: 999px;
    background: var(--destructive);
    color: #fff;
    padding: 0.0625rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.is-active .nav-badge { background: rgb(255 255 255 / 25%); }

.sidebar-note {
    display: none;
    margin-top: auto;
    padding: 0 1.25rem 1rem;
    font-size: 0.75rem;
    line-height: 1.6;
    opacity: 0.5;
}

@media (min-width: 768px) {
    .sidebar-note { display: block; }
}

/* --- cabecera de página y lienzo ----------------------------------------- */

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.page-header-text { min-width: 0; }

.page-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-header-sub {
    margin-top: 0.125rem;
    color: var(--muted-fg);
}

.page-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.page { padding: 1.5rem; }
.page-narrow { max-width: 56rem; }

/* --- superficies ---------------------------------------------------------- */

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.card-pad { padding: 1.25rem; }

.card-title {
    font-size: 0.875rem;
    font-weight: 600;
}

.card-sub {
    margin-top: 0.125rem;
    margin-bottom: 1rem;
    font-size: 0.75rem;
    color: var(--muted-fg);
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* --- tablas densas -------------------------------------------------------- */

.table-wrap {
    overflow-x: auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    padding: 0.625rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted-fg);
    background: var(--muted);
    border-bottom: 1px solid var(--border);
}

.table td { padding: 0.625rem 1rem; }
.table tbody tr + tr td { border-top: 1px solid var(--border); }
.table tbody tr:hover { background: var(--muted); }
.table .right { text-align: right; }

.table a {
    font-weight: 500;
    text-decoration: none;
}

.table a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* --- formularios ---------------------------------------------------------- */

.field {
    display: grid;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
}

label {
    font-size: 0.875rem;
    font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
    width: 100%;
    min-height: 2rem;
    padding: 0.3125rem 0.625rem;
    border: 1px solid var(--input);
    border-radius: var(--radius);
    background: var(--card);
    color: inherit;
    font: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
    min-height: 5rem;
    resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 25%, transparent);
}

input:disabled,
select:disabled,
textarea:disabled {
    background: var(--muted);
    opacity: 0.7;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.form-error {
    color: var(--destructive);
    font-weight: 500;
}

.field-hint {
    font-size: 0.75rem;
    color: var(--muted-fg);
}

/* --- botones -------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    height: 2rem;
    padding: 0 0.75rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--primary);
    color: var(--primary-fg);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.btn:hover { background: color-mix(in oklch, var(--primary) 80%, var(--card)); }
.btn:active { transform: translateY(1px); }

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.5;
    pointer-events: none;
}

.btn-outline {
    background: var(--card);
    border-color: var(--border);
    color: var(--fg);
}

.btn-outline:hover { background: var(--muted); }

.btn-secondary {
    background: var(--muted);
    color: var(--fg);
}

.btn-secondary:hover { background: color-mix(in oklch, var(--muted) 92%, var(--fg)); }

.btn-destructive {
    background: color-mix(in oklch, var(--destructive) 10%, var(--card));
    color: var(--destructive);
}

.btn-destructive:hover { background: color-mix(in oklch, var(--destructive) 20%, var(--card)); }

.btn-ghost {
    background: transparent;
    color: inherit;
}

.btn-ghost:hover { background: var(--muted); }

.btn-sm {
    height: 1.75rem;
    padding: 0 0.625rem;
    font-size: 0.8rem;
}

.btn-sm svg { width: 0.875rem; height: 0.875rem; }

.btn-lg {
    height: 2.25rem;
    padding: 0 0.875rem;
}

.btn-block { width: 100%; }

/* --- estado: puntos, píldoras, notas de inglés, urgencia ------------------ */

.dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    flex-shrink: 0;
    border-radius: 999px;
}

.dot-lg { width: 0.625rem; height: 0.625rem; }

.dot-to-contact { background: #94a3b8; }
.dot-contacted  { background: #0ea5e9; }
.dot-replied    { background: #6366f1; }
.dot-interview  { background: #f59e0b; }
.dot-offer      { background: #10b981; }
.dot-hired      { background: #059669; }
.dot-rejected   { background: #fb7185; }

.pill {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.pill-to-contact { background: #f1f5f9; color: #334155; }
.pill-contacted  { background: #e0f2fe; color: #075985; }
.pill-replied    { background: #e0e7ff; color: #3730a3; }
.pill-interview  { background: #fef3c7; color: #78350f; }
.pill-offer      { background: #d1fae5; color: #064e3b; }
.pill-hired      { background: #059669; color: #fff; }
.pill-rejected   { background: #ffe4e6; color: #9f1239; }

.score {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.score-high   { background: #d1fae5; color: #064e3b; }
.score-medium { background: #fef3c7; color: #78350f; }
.score-low    { background: #f1f5f9; color: #475569; }

.chip {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.chip-overdue { background: #fef2f2; color: #b91c1c; }
.chip-today   { background: #fffbeb; color: #92400e; }
.chip-later   { background: var(--muted); color: var(--muted-fg); }

/* --- estados vacíos ------------------------------------------------------- */

.empty {
    padding: 2.5rem;
    text-align: center;
    background: var(--card);
    border: 1px dashed var(--border);
    border-radius: 0.75rem;
}

.empty h2 {
    font-size: 1rem;
    font-weight: 600;
}

.empty p {
    max-width: 28rem;
    margin: 0.25rem auto 0;
    color: var(--muted-fg);
}

.empty-icon {
    width: 2rem;
    height: 2rem;
    margin-bottom: 0.75rem;
    color: #10b981;
}

.empty-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

/* --- listas con separadores ---------------------------------------------- */

.list {
    list-style: none;
    padding: 0;
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.list > li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 1rem;
}

.list > li + li { border-top: 1px solid var(--border); }

.list-grow { min-width: 0; flex: 1; }

.list-title {
    font-weight: 500;
    text-decoration: none;
}

.list-title:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* --- tiles de métricas ---------------------------------------------------- */

.stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 1024px) {
    .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.stat {
    display: block;
    padding: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s, background-color 0.15s;
}

a.stat:hover {
    border-color: color-mix(in oklch, var(--primary) 40%, var(--border));
    background: color-mix(in oklch, var(--primary) 5%, var(--card));
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted-fg);
}

.stat-value {
    margin-top: 0.25rem;
    font-size: 1.5rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.stat-hint {
    margin-top: 0.125rem;
    font-size: 0.75rem;
    color: var(--muted-fg);
}

/* --- tablero kanban ------------------------------------------------------- */

.board {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.column {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 18rem;
    border: 1px solid transparent;
    border-radius: 0.75rem;
    background: var(--muted);
    transition: background-color 0.15s, border-color 0.15s;
}

/* Las columnas de cierre van estrechas: son archivo, no trabajo del día. */
.column-closed { width: 13rem; }

.column.is-over {
    border-color: var(--primary);
    background: color-mix(in oklch, var(--primary) 8%, var(--card));
}

.column-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.column-count {
    margin-left: auto;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    background: var(--card);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-fg);
    font-variant-numeric: tabular-nums;
}

.column-cards {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none;
    padding: 0 0.5rem 0.5rem;
}

.column-empty {
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.75rem;
    color: var(--muted-fg);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.board-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: box-shadow 0.15s, opacity 0.15s;
}

.board-card:hover { box-shadow: 0 4px 12px rgb(15 23 42 / 10%); }
.board-card.is-dragging { opacity: 0.5; }

.board-card-top {
    display: flex;
    align-items: flex-start;
    gap: 0.375rem;
    padding: 0.75rem 0.75rem 0.5rem;
}

.card-grip {
    margin: 1px 0 0 -0.25rem;
    padding: 0.125rem;
    border: 0;
    border-radius: 0.25rem;
    background: none;
    color: color-mix(in oklch, var(--muted-fg) 60%, transparent);
    cursor: grab;
}

.card-grip:hover {
    background: var(--muted);
    color: var(--fg);
}

.card-grip:active { cursor: grabbing; }

.board-card-name {
    flex: 1;
    min-width: 0;
    font-weight: 500;
    line-height: 1.3;
}

.board-card-name span {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--muted-fg);
}

.board-card-due { padding: 0 0.75rem 0.5rem; }

.board-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--muted-fg);
}

.board-card-foot a {
    flex-shrink: 0;
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

.board-card-foot a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --- toast de flash ------------------------------------------------------- */

.toasts {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 50;
    display: grid;
    gap: 0.5rem;
}

.toast {
    padding: 0.625rem 0.875rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-weight: 500;
}

/* --- login ---------------------------------------------------------------- */

.login {
    display: grid;
    min-height: 100vh;
}

.login-side { display: none; }

@media (min-width: 1024px) {
    .login { grid-template-columns: 1fr 1fr; }

    .login-side {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 2.5rem;
        background: var(--sidebar);
        color: var(--sidebar-fg);
    }
}

.login-pitch { max-width: 24rem; }

.login-claim {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.35;
}

.login-pitch p + p {
    margin-top: 0.75rem;
    opacity: 0.7;
}

.login-foot {
    font-size: 0.75rem;
    opacity: 0.5;
}

.login-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-form form {
    display: grid;
    gap: 1.25rem;
    width: 100%;
    max-width: 24rem;
}

.login-title h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.login-title p { margin-top: 0.25rem; }

.login-form .field { margin-bottom: 0; }

/* --- impresión (vista A4 del CV) ------------------------------------------ */

@page {
    size: A4;
    margin: 14mm;
}

@media print {
    .sidebar,
    .page-header,
    .toasts,
    .no-print {
        display: none !important;
    }

    body { background: #fff; }
    .app { display: block; }
    .page { padding: 0; }
}
