/* SETECOM Public Design System — ver .cursor/rules/setecom-design.mdc */
@import url('/css/setecom-work-orders.css');

:root {
    --header-h: 52px;
    --max: 72rem;
    --pad: 16px;
    --fg: #0a0a0a;
    --muted: #525252;
    --border: #e5e5e5;
    --bg: #fff;
    --surface: #fafafa;
    --dark: #0a0a0a;
    --dark-border: #262626;
    --dark-muted: #737373;
    --dark-text: #e5e5e5;
}

[x-cloak] { display: none !important; }
.page-app { background: var(--surface); min-height: calc(100vh - var(--header-h, 52px)); }
.page-container { padding: 20px; max-width: var(--max); margin: 0 auto; }
.page-main { min-height: calc(100vh - var(--header-h, 52px)); }
.page-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.page-head__lead { font-size: 13px; color: var(--muted); margin-top: 4px; }
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    margin-bottom: 20px;
}
.stat { background: var(--bg); padding: 12px; text-align: center; }
.stat__n { font-size: 20px; font-weight: 700; }
.stat__l { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-top: 2px; }
.form-card { border: 1px solid var(--border); background: var(--bg); margin-bottom: 16px; }
.form-card__head {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-card__body { padding: 16px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .form-grid-2 { grid-template-columns: 1fr 1fr; } }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.field-error { font-size: 12px; color: #b91c1c; margin-top: 4px; }
.profile-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { .profile-grid { grid-template-columns: 280px 1fr; } }
.profile-card { border: 1px solid var(--border); background: var(--bg); }
.profile-card__head { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.profile-card__head h2 { font-size: 13px; font-weight: 700; }
.profile-card__body { padding: 16px; }
.profile-avatar-wrap { text-align: center; }
.profile-avatar {
    width: 100px; height: 100px; border-radius: 50%; margin: 0 auto 12px;
    border: 1px solid var(--border); background: var(--surface);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; font-size: 32px; font-weight: 700; color: var(--muted);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-meta { font-size: 12px; color: var(--muted); }
.profile-meta strong { display: block; color: var(--fg); font-size: 15px; margin-bottom: 2px; }
.profile-stat { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.profile-stat:last-child { border-bottom: 0; }
.profile-stat span:first-child { color: var(--muted); }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.profile-alert { border: 1px solid var(--border); padding: 12px 16px; font-size: 13px; }
.profile-alert--ok { border-color: #86efac; background: #f0fdf4; color: #166534; }
.profile-alert--err { border-color: #fca5a5; background: #fef2f2; color: #991b1b; }
.pw-wrap { position: relative; }
.pw-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; }
.goal-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 768px) { .goal-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .goal-grid { grid-template-columns: repeat(3, 1fr); } }
.goal-progress { height: 4px; background: var(--surface); border: 1px solid var(--border); }
.goal-progress__bar { height: 100%; transition: width .3s ease; }
.goal-graph-container { width: 100%; padding: 10px 0; position: relative; overflow-x: auto; }
.goal-graph-wrapper { display: flex; min-width: 0; }
.goal-graph { display: flex; flex: 1; justify-content: space-between; gap: 1px; }
.goal-graph-week { display: flex; flex-direction: column; gap: 1px; flex: 1; max-width: 20px; }
.goal-graph-day {
    aspect-ratio: 1; width: 100%; border-radius: 2px; background: #ebedf0;
    cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
}
.goal-graph-day:hover:not(.goal-graph-day--empty):not(.goal-graph-day--future) {
    transform: scale(2); box-shadow: 0 4px 15px rgba(0,0,0,.4); z-index: 100; position: relative;
}
.goal-graph-day--completed { background: var(--goal-color, #22c55e); }
.goal-graph-day--today { outline: 2px solid var(--dark); outline-offset: 1px; }
.goal-graph-day--future { background: #f3f4f6; cursor: default; opacity: .4; }
.goal-graph-day--wildcard {
    background: repeating-linear-gradient(45deg, #fbbf24, #fbbf24 2px, #f59e0b 2px, #f59e0b 4px);
}
.goal-graph-day--wildcard.goal-graph-day--completed {
    background: var(--goal-color, #22c55e); box-shadow: inset 0 0 0 2px #fbbf24;
}
.goal-graph-day--empty { visibility: hidden; }
.goal-graph-day-labels {
    display: flex; flex-direction: column; justify-content: space-between;
    margin-right: 4px; font-size: 9px; color: var(--muted); flex-shrink: 0; padding: 2px 0;
}
.goal-graph-day-label { display: flex; align-items: center; flex: 1; }
.goal-graph-month-labels {
    display: flex; justify-content: space-between; font-size: 11px; color: var(--muted);
    margin-bottom: 6px; padding-left: 28px;
}
.goal-graph-month-label { text-align: center; flex: 1; }
.goal-graph-legend {
    display: flex; align-items: center; justify-content: flex-end; gap: 6px;
    margin-top: 12px; font-size: 11px; color: var(--muted);
}
.goal-graph-legend-swatch { width: 12px; height: 12px; border-radius: 2px; }
.goal-graph-legend-swatch--0 { background: #ebedf0; }
.goal-graph-legend-swatch--1 { background: color-mix(in srgb, var(--goal-color, #22c55e) 25%, #ebedf0); }
.goal-graph-legend-swatch--2 { background: color-mix(in srgb, var(--goal-color, #22c55e) 60%, #ebedf0); }
.goal-graph-legend-swatch--3 { background: var(--goal-color, #22c55e); }
.goal-graph-legend-swatch--wildcard {
    background: repeating-linear-gradient(45deg, #fbbf24, #fbbf24 2px, #f59e0b 2px, #f59e0b 4px);
}
.goal-graph-tooltip {
    position: fixed; background: var(--dark); color: #fff; padding: 8px 14px;
    border-radius: 4px; font-size: 12px; font-weight: 500; white-space: nowrap;
    pointer-events: none; z-index: 999999; box-shadow: 0 8px 30px rgba(0,0,0,.4);
    opacity: 0; transition: opacity .1s;
}
.goal-graph-tooltip.visible { opacity: 1; }
.task-calendar { border: 1px solid var(--border); overflow: hidden; }
.task-calendar__head { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface); border-bottom: 1px solid var(--border); }
.task-calendar__head div { padding: 10px; text-align: center; font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.task-calendar__grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.task-calendar__cell {
    min-height: 100px; padding: 6px; border: 1px solid var(--border);
    cursor: pointer; font-size: 12px;
}
.task-calendar__cell:hover { background: var(--surface); }
.task-calendar__cell--muted { background: var(--surface); opacity: .6; }
.task-calendar__cell--today { background: color-mix(in srgb, var(--accent) 8%, var(--bg)); outline: 2px solid var(--accent); outline-offset: -2px; }
.task-calendar__day-num { font-weight: 600; margin-bottom: 4px; }
.task-calendar__chip {
    font-size: 10px; padding: 2px 4px; margin-bottom: 2px; border-left: 2px solid;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.task-calendar__chip--high { border-color: #dc2626; background: #fef2f2; }
.task-calendar__chip--medium { border-color: #d97706; background: #fffbeb; }
.task-calendar__chip--low { border-color: #16a34a; background: #f0fdf4; }
.task-list-item { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.task-list-item:hover { background: var(--surface); }
.task-list-item--done h4 { text-decoration: line-through; color: var(--muted); }
.movement-type-badge { padding: 2px 8px; border-radius: 2px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.movement-type-IN { background: #dcfce7; color: #166534; }
.movement-type-OUT { background: #fee2e2; color: #991b1b; }
.movement-type-ADJUSTMENT { background: #ffedd5; color: #c2410c; }
.movement-type-TRANSFER { background: #dbeafe; color: #1d4ed8; }
.movement-type-LOSS { background: #f3f4f6; color: #6b7280; }
.movement-type-RETURN { background: #f3e8ff; color: #7c3aed; }
.calc-card { border: 1px solid var(--border); background: var(--bg); padding: 14px; }
.calc-card.row-active { outline: 2px solid var(--accent); outline-offset: -1px; }
.calc-card.has-changes { border-left: 3px solid #f59e0b; }
.calc-card.saved { border-left: 3px solid #22c55e; }
.price-calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; font-size: 12px; }
@media (max-width: 768px) { .price-calc-grid { grid-template-columns: 1fr 1fr; } }
.suggested-price { background: var(--surface); border: 1px solid #86efac; padding: 8px 10px; font-weight: 700; }
.goal-timer-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    z-index: 50;
    width: 14rem;
    padding: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
}
.goal-timer-display {
    margin-bottom: 10px;
    padding: 10px;
    text-align: center;
    border: 1px solid var(--border);
    background: var(--dark);
    color: #fff;
}
.goal-timer-countdown { font-size: 22px; font-weight: 700; font-family: monospace; }
.kanban-board { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) { .kanban-board { grid-template-columns: repeat(4, 1fr); } }
.kanban-col { border: 1px solid var(--border); background: var(--surface); min-height: 280px; }
.kanban-col__head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; }
.kanban-col__body { padding: 10px; display: grid; gap: 8px; min-height: 200px; }
.kanban-card { border: 1px solid var(--border); background: var(--bg); padding: 10px; cursor: move; }
.kanban-card--done { opacity: .7; }
.kanban-card--ghost { opacity: .4; background: var(--surface); }
@media (max-width: 640px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .hide-mobile { display: none !important; }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--fg);
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
}
a { color: inherit; }

.wrap {
    width: 100%;
    max-width: var(--max);
    margin-inline: auto;
    padding-inline: var(--pad);
}

.ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--fg);
    font-size: 13px;
    line-height: 1;
}
.ico--sm { width: 28px; height: 28px; font-size: 12px; }
.ico--lg { width: 40px; height: 40px; font-size: 16px; }
.ico--dark { border-color: var(--dark-border); background: transparent; color: var(--dark-text); }
.ico--plain { width: auto; height: auto; border: 0; background: none; font-size: 12px; color: var(--muted); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    background: none;
    color: inherit;
    line-height: 1.2;
}
.btn-primary, .btn-accent { background: var(--fg); color: #fff; border-color: var(--fg); }
.btn-primary:hover, .btn-accent:hover { background: #262626; }
.btn-outline { border-color: var(--border); color: var(--fg); }
.btn-outline:hover { border-color: var(--fg); }
.btn-ghost { padding: 8px; color: var(--muted); }
.btn-sm { padding: 6px 10px; font-size: 12px; }

.section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.input, .select, .textarea {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--fg);
}
.input:focus, .select:focus, .textarea:focus {
    outline: 2px solid var(--fg);
    outline-offset: 1px;
}
.textarea { min-height: 72px; resize: vertical; }
.label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.field { margin-bottom: 12px; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--surface);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge--dark { background: var(--dark); color: #fff; border-color: var(--dark); }

.table-wrap { border: 1px solid var(--border); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }

.strip-dark {
    background: var(--dark);
    color: #fff;
    border-bottom: 1px solid var(--dark-border);
}
.strip-dark a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--pad);
}
.modal {
    background: var(--bg);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: 15px; font-weight: 700; }
.modal-body { padding: 16px; }
.modal-foot {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.empty { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 14px; }

/* ——— Auth (login, registro) ——— */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}
.auth-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    padding: 0 var(--pad);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.auth-top__logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--fg);
}
.auth-top__links {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
}
.auth-top__links a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
}
.auth-top__links a:hover { color: var(--fg); }
.auth-body {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    min-height: 0;
}
@media (min-width: 900px) {
    .auth-body { grid-template-columns: 1fr 1fr; }
}
.auth-aside {
    display: none;
    background: var(--dark);
    color: var(--dark-text);
    padding: 48px var(--pad);
    border-right: 1px solid var(--dark-border);
}
@media (min-width: 900px) {
    .auth-aside { display: flex; flex-direction: column; justify-content: center; }
}
.auth-aside__inner { max-width: 28rem; }
.auth-aside h1 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 16px;
}
.auth-aside p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--dark-muted);
    margin-bottom: 28px;
}
.auth-aside__list {
    list-style: none;
    display: grid;
    gap: 12px;
}
.auth-aside__list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--dark-muted);
}
.auth-aside__list .ico {
    border-color: var(--dark-border);
    background: transparent;
    color: var(--dark-text);
}
.auth-aside__list strong {
    display: block;
    color: var(--dark-text);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}
.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px var(--pad) 48px;
}
.auth-card {
    width: 100%;
    max-width: 400px;
}
.auth-card h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}
.auth-card__lead {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 24px;
}
.auth-alert {
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.45;
}
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 4px 0 16px;
    font-size: 12px;
    color: var(--muted);
}
.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.auth-check input { width: 14px; height: 14px; accent-color: var(--fg); }
.auth-foot {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
    text-align: center;
    line-height: 1.5;
}
.auth-foot a { text-decoration: underline; color: var(--fg); }
.auth-pw-wrap { position: relative; }
.auth-pw-wrap .input { padding-right: 40px; }
.auth-pw-toggle {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 36px;
    border: 0;
    background: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 13px;
}
.auth-pw-toggle:hover { color: var(--fg); }
