:root {
  color-scheme: light;
  --navy: #10262d;
  --navy-deep: #0a1f25;
  --text: #1c3036;
  --muted: #72848a;
  --line: #e8eef0;
  --background: #f6f8f8;
  --teal: #147d72;
  --teal-dark: #126b61;
  --mint: #e4f5ed;
  --orange: #d89547;
  --radius: 17px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: var(--background); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .46; }
input, textarea, select { color: var(--text); }
input:focus, textarea:focus, select:focus { outline: 2px solid #b6dfd4; outline-offset: 1px; border-color: #65b4a3 !important; }
.hidden { display: none !important; }
.eyebrow { margin: 0; letter-spacing: .15em; font-size: 11px; font-weight: 800; color: var(--teal); }
.eyebrow.light { color: #9edace; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 9px; border-radius: 10px; border: 1px solid transparent; padding: 12px 17px; font-weight: 700; font-size: 13px; transition: background .15s, transform .15s; text-decoration: none; white-space: nowrap; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:focus-visible, .nav-link:focus-visible, .text-button:focus-visible { outline: 3px solid #73b9ab; outline-offset: 2px; }
.button-primary { color: white; background: var(--teal); box-shadow: 0 4px 14px #147d721f; }
.button-primary:hover:not(:disabled) { background: var(--teal-dark); }
.button-outline { background: white; color: #345158; border-color: #dce7e9; }
.button-outline:hover:not(:disabled) { background: #f2f8f7; }
.button-light { background: #f0faf6; color: #166c62; }
.button-plus { font-size: 20px; line-height: 10px; font-weight: 400; }
.loading-screen { min-height: 100vh; display: flex; justify-content: center; align-items: center; gap: 15px; font-weight: 650; color: #45626a; }
.spinner { width: 27px; height: 27px; border: 3px solid #d7ede7; border-top-color: var(--teal); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Login */
.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(350px, 48%) 1fr; background: white; }
.login-aside { background: radial-gradient(circle at 88% 78%, #205f59 0, transparent 46%), linear-gradient(140deg, #0e252b 25%, #143f43 100%); color: white; position: relative; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding: clamp(35px, 5vw, 100px); }
.aside-content { position: relative; z-index: 1; max-width: 470px; }
.wordmark { font-weight: 900; letter-spacing: .18em; font-size: 21px; display: flex; align-items: center; gap: 8px; }
.wordmark-dot { width: 7px; height: 7px; border-radius: 50%; background: #e2ad63; }
.aside-line { width: 36px; height: 3px; border-radius: 2px; background: #e4aa57; margin: 74px 0 29px; }
.login-aside h1 { font-size: clamp(39px, 4.1vw, 67px); line-height: 1.15; letter-spacing: -.065em; font-weight: 800; margin: 17px 0 24px; }
.login-aside h1 em { font-style: normal; color: #a6dfca; }
.login-aside .aside-content > p:last-of-type { color: #b1c7c7; font-size: 15px; max-width: 370px; line-height: 1.85; }
.aside-orb { position: absolute; pointer-events: none; border-radius: 50%; }
.orb-one { width: 390px; height: 390px; border: 1px solid #ffffff15; left: 61%; top: 52%; }
.orb-two { width: 250px; height: 250px; border: 1px solid #ffffff12; left: 75%; top: 85%; }
.aside-footer { position: absolute; left: clamp(35px, 5vw, 100px); bottom: 28px; font-size: 12px; color: #8dadad; }
.login-main { display: flex; justify-content: center; align-items: center; padding: 40px 26px; }
.login-box { width: min(100%, 430px); }
.brand-logo { flex-shrink: 0; width: 51px; height: 51px; border-radius: 12px; background-color: white; background-image: url('/logo-systec.png'); background-repeat: no-repeat; background-position: 82% center; background-size: auto 145%; box-shadow: inset 0 0 0 1px #edf1f1; }
.brand-logo-large { width: 96px; height: 96px; border-radius: 22px; background-size: auto 145%; box-shadow: 0 6px 28px #173f4015, inset 0 0 0 1px #e9eeee; }
.login-intro { margin: 35px 0 33px; }
.login-intro h2 { letter-spacing: -.04em; font-size: 29px; margin: 10px 0; }
.login-intro > p:last-child { font-size: 14px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 11px; }
.stack label { font-size: 13px; font-weight: 750; }
.stack > input, .password-wrap input { width: 100%; border: 1px solid #dfe8e9; border-radius: 10px; background: #fbfcfc; padding: 14px 15px; font-size: 14px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 83px; }
.password-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--teal); font-size: 12px; font-weight: 700; background: transparent; border: 0; padding: 5px; }
.login-button { width: 100%; margin-top: 13px; padding: 15px; justify-content: space-between; }
.login-button span { font-size: 21px; font-weight: 400; }
.login-note { margin: 33px 0 0; color: #839296; font-size: 12px; display: flex; align-items: center; gap: 9px; }
.dot-green { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #25ba82; box-shadow: 0 0 0 4px #25ba8217; vertical-align: middle; }

/* Aplicación */
.app-shell { display: grid; grid-template-columns: 242px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--navy-deep); color: #e4f1ef; min-height: 100vh; display: flex; flex-direction: column; padding: 29px 15px 22px; position: sticky; top: 0; height: 100vh; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 12px; }
.sidebar-brand strong { display: block; font-weight: 900; letter-spacing: .09em; font-size: 17px; line-height: 1.25; }
.sidebar-brand span { font-weight: 700; letter-spacing: .20em; font-size: 9px; color: #92b9b4; }
.sidebar-label { color: #557a7e; font-weight: 800; font-size: 10px; letter-spacing: .13em; padding: 53px 17px 17px; }
.sidebar nav { display: grid; gap: 6px; }
.nav-link { width: 100%; display: flex; align-items: center; gap: 12px; padding: 13px 14px; color: #a1b9b9; background: transparent; border: 0; border-radius: 10px; text-align: left; font-size: 13px; font-weight: 640; }
.nav-link:hover { background: #ffffff0a; color: white; }
.nav-link.active { background: #204b4d; color: #f4fffb; box-shadow: inset 3px 0 0 #50c4a1; }
.nav-icon { width: 23px; height: 23px; line-height: 22px; font-size: 21px; text-align: center; font-weight: 400; }
.nav-arrow { margin-left: auto; color: #719f9b; font-size: 22px; font-weight: 400; }
.sidebar-bottom { margin-top: auto; }
.sidebar-helper { border: 1px solid #225154; background: #16383d; border-radius: 13px; padding: 17px; margin-bottom: 25px; }
.sidebar-helper > span { display: inline-block; margin-bottom: 9px; color: #deac69; font-size: 20px; }
.sidebar-helper strong { display: block; font-size: 12px; }
.sidebar-helper p { color: #91b5b3; font-size: 11px; line-height: 1.7; margin: 8px 0 0; }
.sidebar-user { display: flex; align-items: center; gap: 10px; border-top: 1px solid #25444b; padding: 18px 6px 0; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; background: #285b56; border-radius: 10px; font-weight: 800; }
.user-text { flex: 1; min-width: 0; }
.user-text strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.user-text span { color: #7fa19e; font-size: 10px; }
.icon-button { border: 0; background: transparent; color: #9ababa; font-size: 24px; border-radius: 8px; }
.icon-button:hover { background: #ffffff17; }
.workspace { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { height: 76px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(24px, 3.4vw, 58px); border-bottom: 1px solid #e9eeef; background: #fff; gap: 18px; }
.breadcrumb { color: #8b999e; font-size: 12px; }
.breadcrumb span { margin: 0 11px; color: #cbd5d5; }
.breadcrumb strong { color: #253e44; }
.topbar-right { display: flex; align-items: center; gap: 24px; }
.topbar-status { display: flex; align-items: center; gap: 9px; color: #67827e; font-size: 11px; font-weight: 600; }
.topbar-divider { height: 22px; width: 1px; background: #e3ebeb; }
.topbar-name { font-size: 13px; font-weight: 700; }
.mobile-logo, .mobile-only { display: none; }
.content { width: min(1500px, 100%); margin: 0 auto; padding: 40px clamp(24px, 3.4vw, 58px) 64px; flex: 1; }
.welcome-bar, .section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 33px; }
.welcome-bar h1, .section-head h1 { margin: 13px 0 8px; font-weight: 800; letter-spacing: -.055em; font-size: clamp(27px, 2.6vw, 35px); }
.welcome-bar p:last-child, .section-head p:last-child { color: var(--muted); font-size: 13px; margin: 0; }
.eyebrow-stroke { margin: 0 8px; opacity: .4; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; }
.stat-card { min-height: 193px; padding: 23px; background: white; border: 1px solid #eaf0ef; border-radius: var(--radius); box-shadow: 0 5px 24px #17363804; display: flex; flex-direction: column; }
.stat-card-dark { color: #fff; background: linear-gradient(125deg, #143d42, #0e2d34); border-color: transparent; }
.stat-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 11px; font-weight: 700; color: #647b82; }
.stat-card-dark .stat-top { color: #a5cfca; }
.stat-symbol { width: 35px; height: 35px; display: grid; place-items: center; background: #285458; border-radius: 11px; color: #b4ede2; font-weight: 800; font-size: 19px; flex-shrink: 0; }
.symbol-mint { background: #e6f8ef; color: #158b65; }
.symbol-blue { background: #edf2ff; color: #6887b5; }
.symbol-orange { background: #fff2e4; color: #d99649; }
.stat-number { margin-top: auto; padding-top: 20px; font-weight: 850; font-size: clamp(27px, 2.6vw, 38px); line-height: 1.2; letter-spacing: -.05em; }
.currency-number { font-size: clamp(22px, 2.25vw, 31px); }
.stat-bottom { font-size: 11px; color: #94a4a8; margin-top: 10px; }
.stat-card-dark .stat-bottom { color: #83b9b5; }
.small-status { color: #21b987; }
.warning-dot { color: #e4a75c; }
.dashboard-columns { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr); gap: 19px; margin-top: 25px; }
.surface { border: 1px solid #e8eeee; background: white; border-radius: var(--radius); box-shadow: 0 4px 16px #25434704; }
.recent-surface { padding: 27px; min-height: 355px; }
.surface-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.surface-heading h2 { font-size: 17px; margin: 0 0 6px; letter-spacing: -.03em; }
.surface-heading p { font-size: 12px; margin: 0; color: #91a0a5; }
.text-button { background: transparent; border: 0; color: var(--teal); font-size: 12px; font-weight: 800; white-space: nowrap; }
.recent-products { display: grid; }
.recent-row { display: flex; align-items: center; gap: 13px; padding: 16px 0; border-top: 1px solid #f0f3f3; }
.product-mini-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: #ebf6f2; color: #4b9586; font-size: 19px; font-weight: 750; flex-shrink: 0; }
.recent-row-name { flex: 1; min-width: 0; }
.recent-row-name strong { display: block; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.recent-row-name span { color: #9aa9ac; font-size: 11px; }
.recent-row-stock { font-size: 12px; font-weight: 750; color: #56706d; white-space: nowrap; }
.quick-panel { position: relative; overflow: hidden; padding: 32px; border-radius: var(--radius); background: linear-gradient(155deg, #1a5555 0%, #103b41 100%); color: white; min-height: 350px; display: flex; flex-direction: column; align-items: flex-start; }
.quick-star { font-size: 26px; color: #ddbb77; margin-bottom: 20px; }
.quick-panel h2 { font-size: clamp(25px, 2.4vw, 34px); letter-spacing: -.05em; line-height: 1.2; max-width: 260px; margin: 13px 0; }
.quick-panel > p:not(.eyebrow) { font-size: 12px; color: #abd0cd; line-height: 1.85; max-width: 265px; }
.quick-panel .button { margin-top: auto; z-index: 1; }
.quick-pattern { width: 240px; height: 240px; border-radius: 50%; border: 1px solid #ffffff14; position: absolute; right: -125px; bottom: -125px; box-shadow: 0 0 0 37px #ffffff06, 0 0 0 75px #ffffff04; }
.empty-note { color: #829397; font-size: 13px; padding: 28px 0; }
.app-footer { display: flex; justify-content: space-between; padding: 17px clamp(24px, 3.4vw, 58px); font-size: 10px; color: #a8b2b6; border-top: 1px solid #e9efef; }

/* Catálogo */
.head-actions { display: flex; gap: 9px; }
.inventory-surface { overflow: hidden; }
.filters-row { display: flex; align-items: center; gap: 10px; padding: 21px; }
.search-field { height: 43px; border: 1px solid #e1eaeb; background: #fafcfc; border-radius: 10px; display: flex; align-items: center; padding: 0 12px; gap: 8px; flex: 1; min-width: 110px; }
.search-icon { color: #8ba2a4; font-size: 23px; line-height: 1; }
.search-field input { background: transparent; border: 0; width: 100%; min-width: 0; font-size: 12px; outline: none; }
.filters-row select { height: 43px; max-width: 220px; border: 1px solid #e1eaeb; background: #fafcfc; border-radius: 10px; padding: 0 12px; color: #536a71; font-size: 12px; }
.filters-row .button { height: 43px; }
.table-scroll { width: 100%; overflow-x: auto; }
.data-table { border-collapse: collapse; width: 100%; min-width: 760px; }
.data-table thead { background: #f9fbfb; }
.data-table th { text-align: left; color: #819196; font-size: 10px; letter-spacing: .095em; padding: 17px 20px; border-top: 1px solid #eef2f2; border-bottom: 1px solid #eef2f2; white-space: nowrap; font-weight: 800; }
.data-table td { padding: 15px 20px; border-bottom: 1px solid #f0f3f3; font-size: 12px; vertical-align: middle; }
.data-table tbody tr:hover { background: #fbfdfd; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.product-cell { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.product-cell .product-mini-icon { width: 35px; height: 35px; font-size: 16px; }
.product-cell strong { display: block; max-width: 270px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.product-cell small { display: block; color: #94a4a8; margin-top: 4px; font-size: 10px; }
.code-text { color: #809195; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 11px; }
.price-text { font-weight: 750; white-space: nowrap; }
.qty-pill { display: inline-flex; align-items: center; padding: 6px 9px; border-radius: 8px; color: #147d64; background: #e9f8f0; font-size: 11px; font-weight: 800; }
.qty-pill.low { color: #c37d2e; background: #fff2e5; }
.location-text { color: #85979b; }
.actions-cell { text-align: right !important; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.table-action { color: #487c76; padding: 7px 9px; border-radius: 7px; border: 1px solid #e2efec; background: #f8fbfa; font-size: 11px; font-weight: 750; white-space: nowrap; }
.table-action:hover { background: #e6f5ef; }
.table-action.more { border-color: transparent; background: transparent; color: #93a2a3; font-size: 12px; }
.table-action.danger:hover { color: #bc4b45; background: #ffefed; }
.empty-row { text-align: center; padding: 60px 18px !important; color: #8a9da1; }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; color: #94a3a5; font-size: 11px; border-top: 1px solid #eef2f2; gap: 15px; }
.pagination > div { display: flex; gap: 9px; }
.button-pagination { background: #fff; color: #637d80; border-color: #e4ebec; font-size: 11px; padding: 9px 13px; }
.history-table { min-width: 730px; }
.history-action { padding: 5px 8px; border-radius: 7px; background: #edf5f4; font-size: 10px; color: #467b75; font-weight: 800; }
.history-action.count { background: #fff2e5; color: #ac773f; }
.history-action.archive { background: #fff0f0; color: #b75753; }

/* Formularios */
.modal-backdrop { position: fixed; z-index: 40; inset: 0; background: #0b252c9e; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-card { width: min(100%, 620px); max-height: min(94vh, 900px); overflow: auto; background: white; border-radius: 18px; box-shadow: 0 30px 100px #102b3350; }
.modal-card-small { width: min(100%, 465px); }
.modal-heading { padding: 24px 29px 18px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid #f0f3f3; }
.modal-heading h2 { font-size: 21px; letter-spacing: -.04em; margin: 8px 0 0; }
.modal-close { font-size: 27px; line-height: 1; border: 0; background: #f3f6f6; color: #718487; border-radius: 8px; height: 33px; width: 33px; }
.modal-close:hover { background: #e8eeee; }
.modal-body { padding: 24px 29px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; margin: 17px 0; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full + .field.full { margin-top: 14px; }
.field label { font-size: 11px; font-weight: 800; color: #435d63; }
.field label span { color: #dc845c; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid #e0e8e9; padding: 12px; border-radius: 9px; background: #fafcfc; font-size: 12px; resize: vertical; }
.input-with-button { display: flex; }
.input-with-button input { border-radius: 9px 0 0 9px; }
.input-with-button button { border: 1px solid #e0e8e9; border-left: 0; background: #ecf5f3; padding: 0 12px; border-radius: 0 9px 9px 0; font-size: 17px; color: #147d72; }
.modal-actions { padding: 16px 29px 23px; display: flex; align-items: center; justify-content: flex-end; gap: 9px; border-top: 1px solid #f0f3f3; }
.form-error { color: #ac3f3c; background: #fff0ef; border: 1px solid #ffdcd9; padding: 11px 12px; border-radius: 8px; font-size: 12px; }
.count-product-name { margin: 0 0 18px; font-size: 15px; font-weight: 850; }
.stock-current { display: flex; align-items: center; justify-content: space-between; border-radius: 9px; background: #edf7f4; color: #547e75; font-size: 12px; padding: 15px; margin-bottom: 18px; }
.stock-current strong { font-size: 24px; color: var(--teal); }
.count-product-name + .stock-current + .field { margin-bottom: 15px; }
.scanner-video { width: 100%; max-height: 230px; background: #15262c; border-radius: 11px; object-fit: cover; }
.scanner-hint { font-size: 12px; color: #829397; margin: 11px 0 22px; }
.toast { position: fixed; z-index: 60; right: 23px; bottom: 23px; background: #112f34; color: white; padding: 14px 19px; border-radius: 11px; box-shadow: 0 13px 38px #07303530; font-size: 13px; font-weight: 650; max-width: calc(100vw - 46px); }
.toast.error { background: #9d3b3b; }

@media (max-width: 1250px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-columns { grid-template-columns: 1fr; }
  .quick-panel { min-height: 275px; }
}
@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 20; top: auto; bottom: 0; left: 0; right: 0; padding: 7px 10px max(6px, env(safe-area-inset-bottom)); height: auto; min-height: 0; display: block; box-shadow: 0 -5px 24px #082d2420; }
  .sidebar-brand, .sidebar-label, .sidebar-bottom, .nav-arrow { display: none; }
  .sidebar nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
  .nav-link { flex-direction: column; text-align: center; gap: 2px; justify-content: center; padding: 7px; border-radius: 7px; font-size: 10px; }
  .nav-link.active { box-shadow: inset 0 3px 0 #6bd4b1; }
  .nav-icon { font-size: 21px; }
  .mobile-logo { display: inline; font-weight: 900; letter-spacing: .1em; font-size: 14px; color: #1f5551; margin-right: 18px; }
  .workspace { padding-bottom: 64px; }
  .content { padding-top: 25px; }
  .topbar { height: 66px; }
  .topbar-right { gap: 13px; }
  .topbar-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; }
  .login-screen { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .login-main { min-height: 100vh; }
}
@media (max-width: 600px) {
  .topbar { padding: 0 20px; }
  .breadcrumb { display: none; }
  .desktop-only { display: none; }
  .mobile-only { display: inline; }
  .content { padding: 25px 15px 50px; }
  .welcome-bar, .section-head { flex-direction: column; align-items: stretch; gap: 20px; margin-bottom: 23px; }
  .welcome-bar h1, .section-head h1 { font-size: 28px; }
  .welcome-bar .button { align-self: flex-start; }
  .stat-grid { gap: 10px; }
  .stat-card { min-height: 156px; padding: 16px; border-radius: 12px; }
  .stat-top { font-size: 10px; }
  .stat-symbol { width: 29px; height: 29px; font-size: 15px; }
  .stat-number { font-size: 27px; }
  .currency-number { font-size: 19px; }
  .stat-bottom { font-size: 10px; }
  .recent-surface, .quick-panel { padding: 21px; }
  .head-actions { flex-wrap: wrap; }
  .head-actions .button { flex: 1; }
  .filters-row { display: grid; grid-template-columns: 1fr auto; padding: 13px; }
  .search-field { grid-column: 1 / -1; }
  .filters-row select { max-width: none; }
  .pagination { align-items: flex-start; }
  .pagination > div { flex-direction: column; }
  .modal-backdrop { padding: 9px; align-items: flex-end; }
  .modal-card { border-radius: 18px 18px 8px 8px; max-height: 93vh; }
  .modal-body { padding: 21px 18px; }
  .modal-heading, .modal-actions { padding-left: 18px; padding-right: 18px; }
  .field-grid { gap: 12px; }
  .app-footer { padding: 14px; }
}
