﻿* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #111418;
  --bg-2: #171b21;
  --surface: #1c2229;
  --surface-2: #222a33;
  --surface-3: #29323d;
  --line: rgba(220, 230, 240, 0.12);
  --line-strong: rgba(220, 230, 240, 0.2);
  --text: #edf2f7;
  --text-soft: #aab6c3;
  --text-muted: #7f8c9a;
  --accent: #2f80ed;
  --accent-2: #16a085;
  --warning: #f2b84b;
  --danger: #ef5b5b;
  --success: #36c275;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  --radius: 8px;
  --radius-sm: 6px;
  --topbar-height: 52px;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(180deg, #161a20 0%, #101317 100%);
  background-size: 44px 44px, 44px 44px, auto;
  font-size: 14px;
  line-height: 1.4;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: rgba(24, 29, 36, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(14px);
}

.logo {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--text);
  box-shadow: 0 10px 24px rgba(47, 128, 237, 0.26);
}

.logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 6px;
}
.menu {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: visible;
}

.menu-item {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
}

.menu-item:hover,
.menu-item:focus-visible,
.dropdown.is-active > .menu-item {
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line);
}

.dropdown {
  position: relative;
  flex: 0 0 auto;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 9px);
  left: 0;
  min-width: 238px;
  max-height: calc(100vh - 82px);
  overflow: auto;
  display: none;
  flex-direction: column;
  padding: 8px;
  background: rgba(31, 38, 46, 0.98);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 1100;
}

.dropdown-menu.open {
  display: flex;
}

.dropdown-item {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  text-decoration: none;
  font-size: 13px;
  font-weight: 550;
}

.dropdown-item:hover,
.dropdown-item:focus-visible {
  outline: none;
  color: var(--text);
  background: rgba(47, 128, 237, 0.14);
}

.dropdown-section-title {
  padding: 9px 10px 5px;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.dropdown-divider {
  height: 1px;
  margin: 7px 4px;
  background: var(--line);
}

.session-info {
  display: none;
  text-align: right;
  line-height: 1.1;
}

.session-title {
  color: var(--text);
  font-weight: 750;
  font-size: 12px;
}

.session-meta {
  color: var(--text-muted);
  font-size: 11px;
}

.user {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.user-name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-soft);
  font-weight: 650;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  font-size: 11px;
  font-weight: 800;
}

.logout-form {
  margin: 0;
}

.logout-button,
.btn,
.btn-mini,
.erp-btn,
.login-button {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 750;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.logout-button {
  min-height: 30px;
  padding: 5px 10px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
  font-size: 12px;
}

.logout-button:hover,
.btn:hover,
.btn-mini:hover,
.erp-btn:hover,
.login-button:hover {
  transform: translateY(-1px);
}

.workspace {
  position: relative;
  flex: 1;
  min-height: calc(100vh - var(--topbar-height));
  overflow: auto;
  padding: 24px 28px 32px;
}

.grid-overlay {
  display: none;
}

.flash-container {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  width: min(720px, calc(100vw - 32px));
  pointer-events: none;
}

.flash {
  margin-bottom: 8px;
  padding: 11px 14px;
  border-radius: var(--radius);
  background: rgba(31, 38, 46, 0.96);
  border: 1px solid var(--line-strong);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 13px;
}

.flash-success { border-left: 4px solid var(--success); }
.flash-error { border-left: 4px solid var(--danger); }
.flash-warning { border-left: 4px solid var(--warning); }

.module-panel,
.erp-module {
  position: relative;
  z-index: 1;
}

.module-panel {
  min-height: calc(100vh - 106px);
  display: flex;
  flex-direction: column;
}

.module-header,
.erp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.module-title,
.erp-title {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}

.module-subtitle,
.erp-subtitle {
  margin: 3px 0 0;
  color: var(--text-soft);
  font-size: 13px;
}

.badge,
.erp-status-pill,
.sc-badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(47, 128, 237, 0.16);
  border: 1px solid rgba(47, 128, 237, 0.42);
  color: #dcecff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.erp-module,
.erp-page.erp-page--full {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.erp-top-grid,
.erp-grid-top {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.erp-card,
.user-form,
.user-list,
.login-card,
.home-panel,
.home-module {
  background: rgba(28, 34, 41, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.erp-card,
.user-form,
.user-list {
  padding: 16px;
}

.erp-card-title {
  margin-bottom: 14px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.erp-form,
.login-form,
.user-form {
  display: grid;
  gap: 12px;
}

.erp-form-row {
  display: grid;
  gap: 7px;
}

input,
select,
textarea,
.login-input,
.erp-card input,
.erp-card select,
.erp-card textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--text);
  background: #11161b;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
}

input[type="file"] {
  padding: 7px;
}

input:focus,
select:focus,
textarea:focus,
.login-input:focus,
.erp-card input:focus,
.erp-card select:focus,
.erp-card textarea:focus {
  border-color: rgba(47, 128, 237, 0.72);
  box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.16);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

.erp-btn,
.login-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  color: #fff;
  background: var(--accent);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 22px rgba(47, 128, 237, 0.22);
}

.erp-btn.secondary,
.btn,
.btn-mini {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line-strong);
  box-shadow: none;
  text-decoration: none;
}

.erp-btn:disabled,
.login-button:disabled,
.btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.btn {
  min-height: 34px;
  padding: 7px 12px;
}

.btn-mini {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  margin: 0 2px;
  font-size: 12px;
}

.erp-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.erp-kpi {
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px;
  background: #151a20;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.erp-kpi-label {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.erp-kpi-value {
  margin-top: 3px;
  color: var(--text);
  font-size: 24px;
  font-weight: 850;
  line-height: 1;
}

.table-wrapper,
.erp-preview,
.erp-tablewrap {
  background: rgba(20, 25, 31, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.table-wrapper {
  flex: 1;
  overflow: auto;
}

.erp-preview {
  margin-top: 18px;
  padding: 12px;
}

.erp-preview-wrapper,
.erp-tablewrap {
  width: 100%;
  max-height: 56vh;
  overflow: auto;
  border-radius: var(--radius-sm);
}

.data-table,
.inventory-table,
.erp-preview table,
.erp-table,
.erp-table-resizable {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
  color: var(--text);
  font-size: 12px;
}

.data-table thead,
.inventory-table thead,
.erp-preview thead,
.erp-table thead {
  background: #11161b;
}

.data-table th,
.data-table td,
.inventory-table th,
.inventory-table td,
.erp-preview th,
.erp-preview td,
.erp-table th,
.erp-table td,
.erp-table-resizable th,
.erp-table-resizable td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(220, 230, 240, 0.08);
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}

.data-table th,
.inventory-table th,
.erp-preview th,
.erp-table th,
.erp-table-resizable th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #dbe7f3;
  background: #11161b;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.data-table tbody tr:nth-child(even),
.inventory-table tbody tr:nth-child(even),
.erp-preview tbody tr:nth-child(even),
.erp-table tbody tr:nth-child(even),
.erp-table-resizable tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.018);
}

.data-table tbody tr:hover,
.inventory-table tbody tr:hover,
.erp-preview tbody tr:hover,
.erp-table tbody tr:hover,
.erp-table-resizable tbody tr:hover {
  background: rgba(47, 128, 237, 0.08);
}

.empty-state {
  color: var(--text-muted);
  font-size: 13px;
}

.module-panel > .empty-state {
  max-width: 620px;
  margin-top: 56px;
  padding: 18px;
  background: rgba(28, 34, 41, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.inventory-table .num,
.num {
  text-align: right;
}

.inventory-table .row-total {
  font-weight: 800;
  background: rgba(47, 128, 237, 0.08);
}

.acciones {
  text-align: center;
  white-space: nowrap;
}

.col-resizer {
  position: absolute;
  right: 0;
  top: 0;
  width: 5px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(180deg, #171b21, #101317);
  background-size: 44px 44px, 44px 44px, auto;
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.login-title {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  font-weight: 850;
}

.login-subtitle {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 13px;
}

.login-label {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.login-flash {
  position: static;
  transform: none;
  width: 100%;
  margin-bottom: 12px;
  pointer-events: auto;
}

.login-flash .flash {
  box-shadow: none;
}

.user-admin {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 18px;
}

.user-list-title {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.user-list ul {
  margin: 0;
  padding-left: 18px;
}

.user-list li {
  margin-bottom: 8px;
  color: var(--text-soft);
}

.home-shell {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
}

.home-panel {
  min-height: 180px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 24px;
}

.home-eyebrow {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.home-title {
  margin: 6px 0 8px;
  color: var(--text);
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: 0;
}

.home-copy {
  max-width: 760px;
  margin: 0;
  color: var(--text-soft);
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.home-stat {
  min-width: 150px;
  padding: 14px;
  border-radius: var(--radius);
  background: #151a20;
  border: 1px solid var(--line);
}

.home-stat-value {
  font-size: 28px;
  font-weight: 900;
}

.home-stat-label {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 750;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.home-module {
  min-height: 116px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  text-decoration: none;
}

.home-module:hover {
  border-color: rgba(47, 128, 237, 0.42);
  background: rgba(34, 42, 51, 0.98);
}

.home-module-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
}

.home-module-meta {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 12px;
}

.home-module-tag {
  align-self: flex-start;
  margin-top: 14px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #cfeee7;
  background: rgba(22, 160, 133, 0.14);
  border: 1px solid rgba(22, 160, 133, 0.32);
  font-size: 11px;
  font-weight: 800;
}

.opt-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #151a20;
}

.opt-text {
  color: var(--text-soft);
  font-weight: 700;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #11161b;
}

::-webkit-scrollbar-thumb {
  background: #3a4653;
  border-radius: 999px;
  border: 2px solid #11161b;
}

::-webkit-scrollbar-thumb:hover {
  background: #4b5a69;
}

@media (min-width: 1180px) {
  .session-info {
    display: block;
  }
}

@media (max-width: 1180px) {
  .erp-top-grid,
  .erp-grid-top,
  .home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar {
    gap: 10px;
    padding: 0 12px;
  }

  .workspace {
    padding: 18px 14px 24px;
  }

  .user-name {
    display: none;
  }

  .erp-top-grid,
  .erp-grid-top,
  .erp-kpis,
  .user-admin,
  .home-panel,
  .home-grid {
    grid-template-columns: 1fr;
  }

  .module-header,
  .erp-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-title {
    font-size: 30px;
  }
}



