@import url("/assets/photon.tokens.css?v=1.4.0");
@font-face {
  font-family: Outfit;
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/outfit-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Outfit;
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/outfit-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root{--sunken:var(--surface-sunken);--green:var(--accent);--green-soft:var(--accent-soft);--red:var(--danger);--red-soft:var(--danger-soft);--radius:var(--r-lg)}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 12% -10%, var(--glow-1) 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, var(--glow-2) 0%, transparent 50%),
    var(--bg);
  color: var(--ink);
  font-family: Outfit, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }

/* ---------- Login ---------- */
.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 32px;
  box-shadow: var(--shadow-card);
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.brand-mark {
  width: 48px; height: 48px; border-radius: 15px;
  background: var(--ink); color: var(--bg);
  display: grid; place-items: center; font-weight: 600; font-size: 20px;
}
.brand-name { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.brand-sub { color: var(--muted); font-size: 13px; }
.segmented {
  display: flex; gap: 4px; padding: 4px;
  background: var(--sunken); border-radius: 14px; margin-bottom: 20px;
}
.segmented button {
  flex: 1; border: 0; background: transparent; border-radius: 11px;
  padding: 9px 10px; font-size: 14px; color: var(--muted);
}
.segmented button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 13px; background: var(--surface); outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 14%, transparent);
}
.grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.btn {
  border: 0; border-radius: 12px; padding: 12px 16px;
  font-size: 14px; font-weight: 500; text-decoration: none;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--ink-soft); }
.btn-soft { background: var(--sunken); color: var(--ink); }
.btn-soft:hover { background: var(--line); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-danger { background: var(--red-soft); color: var(--danger); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.error { color: var(--danger); font-size: 13px; min-height: 18px; margin: 4px 0 8px; }
.hint { color: var(--muted); font-size: 12px; }
.sso-btn { display: block; margin-bottom: 4px; text-align: center; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--soft); font-size: 12px; margin: 14px 0 4px; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.hint-block { margin-top: 14px; }
.nav-row { padding-top: 0; }

/* ---------- Login (Fito layout) ---------- */
.auth-stage {
  min-height: 100dvh; display: flex; flex-wrap: wrap; align-items: stretch;
  gap: 20px; padding: 20px;
}
.auth-brand {
  position: relative; flex: 1.1 1 480px; min-width: 0;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  overflow: hidden; border-radius: 36px; padding: 40px;
  background: linear-gradient(165deg, var(--peach-grad-1) 0%, var(--peach-grad-2) 50%, var(--peach-grad-3) 100%);
}
.auth-brand::after {
  content: ""; position: absolute; right: -120px; bottom: -140px;
  width: 420px; height: 420px; border-radius: 50%;
  background: rgba(255,255,255,.35); pointer-events: none;
}
.auth-brand-top { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.auth-brand-top strong { font-size: 24px; font-weight: 500; letter-spacing: -0.02em; }
.auth-mark {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: 21px;
}
.auth-brand-copy { display: flex; flex-direction: column; gap: 18px; max-width: 540px; position: relative; z-index: 1; }
.auth-brand-copy h1 {
  font-size: clamp(38px, 4.4vw, 58px); line-height: 1.03;
  letter-spacing: -0.03em; font-weight: 400;
}
.auth-brand-copy p { font-size: 17px; line-height: 1.6; color: var(--peach-ink); max-width: 44ch; }
.auth-points { display: flex; flex-direction: column; gap: 10px; max-width: 440px; position: relative; z-index: 1; }
.auth-point {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.66); border-radius: 14px; padding: 12px 16px;
  font-size: 15px; color: var(--ink-soft);
}
.auth-point .dot {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  flex: 0 0 28px; background: var(--ink); color: var(--peach); font-size: 13px; font-weight: 600;
}
.auth-form {
  flex: 1 1 420px; min-width: 0; display: flex; align-items: center; justify-content: center;
  border-radius: 36px; background: var(--sunken); padding: 34px;
}
.auth-form-inner { width: 100%; max-width: 404px; display: flex; flex-direction: column; gap: 20px; }
.auth-head { display: flex; flex-direction: column; gap: 6px; }
.auth-head h2 { font-size: 34px; line-height: 1.08; letter-spacing: -0.03em; font-weight: 500; }
.auth-head p { font-size: 15.5px; color: var(--muted); }
.auth-fields { display: flex; flex-direction: column; gap: 14px; }
.auth-form .field { margin-bottom: 0; }
.auth-form .field label { font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.auth-form .field input {
  height: 52px; border-radius: 18px; padding: 0 16px; font-size: 16px;
  background: var(--surface); border-color: var(--line);
}
.auth-form .field input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 14%, transparent); }
.btn-lg { height: 56px; font-size: 16px; border-radius: 18px; }
.auth-form .segmented { margin-bottom: 0; }
.auth-form .sso-btn { background: var(--surface); border: 1px solid var(--line); height: 52px; border-radius: 16px; }
.auth-form .sso-btn:hover { background: var(--bg); }
.auth-foot { text-align: center; font-size: 13.5px; color: var(--muted); }
.auth-foot a { color: var(--ink); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 900px) {
  .auth-stage { padding: 12px; gap: 12px; }
  .auth-brand { flex: 1 1 100%; min-height: 280px; padding: 26px; border-radius: 28px; }
  .auth-points { display: none; }
  .auth-form { flex: 1 1 100%; padding: 26px; border-radius: 28px; }
}

/* ---------- App ---------- */
.shell { width: 100%; max-width: none; margin: 0; padding: 20px 22px 60px; display: flex; gap: 20px; align-items: flex-start; }
.rail {
  width: 76px; flex: 0 0 76px; position: sticky; top: 20px;
  height: calc(100dvh - 40px); display: flex; flex-direction: column;
  justify-content: space-between; padding: 2px 0;
}
.rail-top { display: flex; flex-direction: column; align-items: center; gap: 26px; }
.rail-mark {
  width: 48px; height: 48px; border-radius: 14px; background: var(--ink);
  color: var(--bg); display: grid; place-items: center;
  font-weight: 600; font-size: 20px;
}
.rail-nav { display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--sunken); border-radius: 30px; padding: 8px; }
.rail-link {
  width: 52px; height: 52px; border: 0; border-radius: 12px; background: transparent;
  color: var(--ink); display: grid; place-items: center; cursor: pointer;
}
.rail-link:hover { background: var(--line); }
.rail-link[aria-current="page"] { background: var(--line); }
.main { flex: 1; min-width: 0; }
.rail-bottom { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.rail-avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--peach-soft); color: var(--peach-ink); display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 10px 0 18px; }
.page-head h1 { font-size: 34px; line-height: 1.1; font-weight: 500; letter-spacing: -0.01em; margin: 2px 0 0; }
.eyebrow { color: var(--muted); font-size: 13px; }
.mobile-nav { display: none; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 6px 0 18px; flex-wrap: wrap; }
.topbar .brand-mark { display: none; }
.topbar .brand { margin: 0; }
.topbar-spacer { flex: 1; }
.user { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.user a { text-decoration: none; }
.user a:hover { text-decoration: underline; }
.avatar {
  width: 36px; height: 36px; border-radius: 12px; background: var(--peach-soft);
  color: var(--peach-ink); display: grid; place-items: center; font-weight: 600;
}
.nav { display: flex; gap: 4px; background: var(--sunken); padding: 4px; border-radius: 14px; }
.nav button { border: 0; background: transparent; padding: 9px 16px; border-radius: 11px; font-size: 14px; color: var(--muted); }
.nav button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-soft); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.toolbar { display: flex; gap: 10px; padding: 18px; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1; min-width: 220px; }
.search input {
  width: 100%; border: 1px solid var(--line); background: var(--bg);
  border-radius: 12px; padding: 11px 13px 11px 38px; outline: none;
}
.search input:focus { border-color: var(--ink); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--soft); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 12px 18px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-soft); }
.name-cell { font-weight: 500; }
.sub { color: var(--soft); font-size: 12px; }
.pill {
  display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px;
  background: var(--sunken); color: var(--muted); font-size: 12px;
}
.pill.green { background: var(--green-soft); color: var(--green); }
.mono { font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: 4px; justify-content: flex-end; }
.icon-btn {
  border: 0; background: transparent; border-radius: 9px; width: 34px; height: 34px;
  display: grid; place-items: center; color: var(--muted);
}
.icon-btn:hover { background: var(--sunken); color: var(--ink); }
.load-more { padding: 18px; text-align: center; border-top: 1px solid var(--line); }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* ---------- Modal ---------- */
.modal { border: 0; border-radius: 24px; padding: 0; width: min(760px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); }
.modal::backdrop { background: rgba(20, 22, 27, 0.42); }
.modal form { padding: 26px; }
.modal h2 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.modal .hint { margin-bottom: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: .2s ease;
  max-width: min(520px, calc(100vw - 32px));
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.hidden { display: none !important; }

.cards { display: none; }
.logout-short { display: none; }
.card-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.card-row:last-child { border-bottom: 0; }
.card-main { flex: 1; min-width: 0; }
.card-side { text-align: right; font-size: 14px; }

@media (max-width: 720px) {
  .shell { display: block; padding: 14px 14px 92px; }
  .rail { display: none; }
  .user { display: none; }
  .page-head { padding-top: 4px; }
  .page-head h1 { font-size: 30px; }
  .mobile-nav {
    display: block; position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%);
    z-index: 20; width: max-content; max-width: calc(100vw - 28px);
  }
  .mobile-nav-inner {
    display: flex; align-items: center; gap: 4px; background: var(--surface);
    border: 1px solid var(--line); border-radius: 30px; padding: 6px;
    box-shadow: var(--shadow-soft);
  }
  .mobile-nav .rail-link { width: 48px; height: 48px; }
  .brand-name { font-size: 18px; }
  .brand-sub { font-size: 12px; }
  .user .avatar, .user .user-email { display: none; }
  .logout-long { display: none; }
  .logout-short { display: inline; }
  .cards:not(.hidden) { display: block; }
  .cards.hidden { display: none; }
  .topbar { gap: 10px; }
  .nav { order: 3; width: 100%; }
  .nav button { flex: 1; }
  .grid-2 { grid-template-columns: 1fr; }
  thead th, tbody td { padding: 11px 12px; }
}

.doc-lines-head{display:flex;align-items:center;justify-content:space-between;margin-top:14px;font-size:13px;color:var(--muted)}
.doc-lines-head .btn{padding:8px 12px}
.doc-lines{display:flex;flex-direction:column;gap:6px;margin-top:8px}
.doc-line{display:grid;grid-template-columns:64px 58px minmax(120px,1fr) 58px 76px 52px 58px 30px;gap:5px;align-items:center}
.doc-line input{border:1px solid var(--line);border-radius:9px;padding:7px 8px;min-width:0;font-size:12px;background:var(--surface)}
.doc-line .line-find{height:32px;padding:0 6px;font-size:11px;border-radius:9px}
.doc-line .icon-btn{width:30px;height:30px}
@media (max-width:720px){
  .doc-line{grid-template-columns:1fr 1fr;gap:6px;border-bottom:1px solid var(--line);padding-bottom:10px}
  .doc-line .line-name{grid-column:1 / -1}
  .doc-line .line-product-id{display:none}
}
.rail-avatar{text-decoration:none}
.user{text-decoration:none}
.variants-editor{display:flex;flex-direction:column;gap:8px;border-top:1px solid var(--line);padding-top:14px;margin-top:4px}
.variants-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.section-title{font-size:14px;font-weight:600}
.variants-head .hint{margin-top:2px}
.variant-rows{display:flex;flex-direction:column;gap:6px}
.variant-row{display:grid;grid-template-columns:1.1fr 1.5fr .8fr .8fr 36px;gap:6px;align-items:center}
.variant-row input{min-width:0;padding:9px 10px;font-size:13px}
.variant-row .icon-btn{width:36px;height:36px}
@media(max-width:720px){.variant-row{grid-template-columns:1fr 1fr;padding:8px;border:1px solid var(--line);border-radius:10px}.variant-row .v-id{display:none}.variant-row .v-remove{grid-column:2;justify-self:end}.variants-head{align-items:center}}
.integration-card{display:flex;flex-direction:column;gap:12px;background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:22px;margin-top:18px}
.integration-head{display:flex;align-items:center;gap:12px}
.integration-icon{width:44px;height:44px;border-radius:12px;background:var(--ink);color:var(--bg);display:grid;place-items:center;font-weight:600;font-size:18px}
.integration-head .pill{margin-left:auto}

/* Perfil */
.profile-wrap{position:relative}
.rail-avatar{border:0;cursor:pointer;font-family:inherit}
.profile-menu{position:absolute;z-index:50;width:244px;padding:6px;border:1px solid var(--line);border-radius:16px;background:var(--surface);box-shadow:var(--shadow-float)}
.profile-menu[hidden]{display:none}
.rail-bottom .profile-menu{left:calc(100% + 10px);bottom:0}
.profile-bar .profile-menu{right:0;bottom:calc(100% + 10px)}
.profile-identity{display:flex;flex-direction:column;gap:2px;padding:9px 10px 8px}
.profile-identity strong{font-size:14px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.profile-identity span{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.profile-label{padding:7px 10px 3px;font-size:11px;font-weight:500;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.profile-menu a,.profile-menu button{display:flex;align-items:center;gap:8px;width:100%;border:0;border-radius:9px;background:transparent;padding:8px 10px;text-align:left;font-size:14px;color:var(--ink);text-decoration:none}
.profile-menu a:hover,.profile-menu button:hover{background:var(--sunken)}
.profile-menu a span:first-child,.profile-menu button span:first-child{flex:1}
.profile-menu .profile-ext{color:var(--muted);font-size:12px}
.profile-menu .profile-logout{color:var(--danger)}
.profile-separator{height:1px;background:var(--line);margin:5px 0}
