:root {
  color-scheme: light;
  --bg: #f7f7f7;
  --surface: #ffffff;
  --surface-soft: #f1f1f1;
  --text: #111111;
  --muted: #6f6f6f;
  --line: #dedede;
  --black: #050505;
  --red: #b11226;
  --red-dark: #7f0d1b;
  --danger: #b11226;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  --radius: 14px;
  --radius-sm: 8px;
  --font-ui: "Segoe UI", "Inter", system-ui, -apple-system, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg);
}

a {
  color: inherit;
}

code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface);
  font-family: Consolas, "Courier New", monospace;
}

.app-shell {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

.app-shell > header {
  display: flex;
  flex-flow: column;
  justify-content: flex-start;
  flex: 0 0 auto;
  gap: 0.5rem;
}

.app-shell > .content {
  flex: 1 1 auto;
  min-width: 0;
}

.content {
  width: 100%;
  max-width: 1480px;
  padding: 38px;
}

.topbar,
.section-heading,
.topbar-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}

.topbar {
  position: relative;
  justify-content: space-between;
  margin-bottom: 26px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.topbar-subtitle {
  max-width: 760px;
  margin-top: 10px;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.45;
}

.topbar-logo {
  position: absolute;
  left: 50%;
  top: 0;
  width: 92px;
  height: 92px;
  object-fit: contain;
  transform: translateX(-50%);
  animation: headerLogoIn 700ms ease both;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.eyebrow {
  margin: 0 0 6px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--red);
}

h1,
h2 {
  margin: 0;
  line-height: 1.12;
  font-weight: 500;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 4.35rem);
}

h2 {
  font-size: 1.45rem;
}

.section-heading {
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-heading span {
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.88rem;
}

.panel {
  margin-bottom: 24px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.record-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.field-wide {
  grid-column: 1 / -1;
}

.record-form.single {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field span {
  color: #222222;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
}

.field-check {
  align-content: end;
  grid-template-columns: auto 1fr;
  align-items: center;
}

.field-check span {
  order: 2;
}

.field-check input {
  order: 1;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #cfcfcf;
  border-radius: var(--radius-sm);
  color: var(--text);
  background: #ffffff;
  font: 0.95rem "Segoe UI", Arial, sans-serif;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

select[multiple] {
  min-height: 168px;
  padding: 8px;
}

select[multiple] option {
  padding: 8px 10px;
  border-radius: 4px;
}

textarea {
  min-height: 102px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--black);
  outline: 3px solid rgba(177, 18, 38, 0.14);
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--red);
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--black);
  border-radius: var(--radius-sm);
  color: #ffffff;
  background: var(--black);
  font: 800 0.82rem "Segoe UI", Arial, sans-serif;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.button:hover {
  border-color: var(--red);
  background: var(--red);
  transform: translateY(-1px);
}

.button.secondary {
  border-color: #bdbdbd;
  color: var(--black);
  background: #ffffff;
}

.button.secondary:hover {
  border-color: var(--red);
  color: #ffffff;
  background: var(--red);
}

.record-form .button {
  align-self: end;
}

.project-form,
.cliente-form,
.usuario-form {
  grid-template-columns: 1fr;
  gap: 22px;
}

.project-title-block {
  display: grid;
  gap: 16px;
}

.project-title-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.project-title-block input {
  min-height: 58px;
  font-size: 1.15rem;
  font-weight: 700;
}

.project-title-block textarea {
  min-height: 86px;
}

.project-hero-grid,
.project-assets-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.92fr) minmax(360px, 1.08fr);
  gap: 22px;
  align-items: start;
}

.project-main-data,
.project-resources,
.project-notes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.project-resources,
.project-notes-grid {
  align-content: start;
}

.project-divider {
  width: 100%;
  height: 1px;
  margin: 2px 0;
  border: 0;
  background: var(--line);
}

.project-cover,
.project-plan {
  min-height: 370px;
  display: grid;
  align-items: stretch;
}

.field-file-cover,
.field-file-plan {
  min-height: 370px;
  padding: 18px;
  align-content: end;
  border: 1px dashed #a8a8a8;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(5, 5, 5, 0.72), rgba(177, 18, 38, 0.34)),
    url("../../images/sidebar-vertical/sidebar1.webp") center / cover no-repeat;
  color: #ffffff;
}

.field-file-plan {
  background:
    linear-gradient(135deg, rgba(5, 5, 5, 0.74), rgba(17, 17, 17, 0.28)),
    url("../../images/sidebar-vertical/sidebar2.webp") center / cover no-repeat;
}

.field-file-cover span,
.field-file-plan span {
  color: #ffffff;
  font-size: 1rem;
}

.field-file-cover input,
.field-file-plan input {
  border-color: rgba(255, 255, 255, 0.62);
  color: #ffffff;
  background: rgba(0, 0, 0, 0.36);
}

.project-form .button,
.cliente-form .button,
.usuario-form .button {
  width: min(260px, 100%);
}

.field-file-avatar {
  min-height: 220px;
  padding: 18px;
  display: grid;
  align-content: end;
  border: 1px dashed #a8a8a8;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(5, 5, 5, 0.72), rgba(177, 18, 38, 0.34)),
    url("../../images/sidebar-vertical/sidebar1.webp") center / cover no-repeat;
  color: #ffffff;
}

.field-file-avatar span {
  color: #ffffff;
  font-size: 1rem;
}

.field-file-avatar input {
  border-color: rgba(255, 255, 255, 0.62);
  color: #ffffff;
  background: rgba(0, 0, 0, 0.36);
}

.notice {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #171717;
  border-left: 5px solid var(--red);
  border-radius: var(--radius-sm);
  background: #ffffff;
  font: 700 0.95rem "Segoe UI", Arial, sans-serif;
}

.notice.error {
  color: var(--danger);
  border-color: #efb7be;
  border-left-color: var(--danger);
  background: #fff7f8;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.9rem;
}

th {
  position: sticky;
  top: 0;
  color: #ffffff;
  background: var(--black);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

th:first-child {
  border-top-left-radius: var(--radius);
}

th:last-child {
  border-top-right-radius: var(--radius);
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background-color 120ms ease;
}

tbody tr:hover {
  background: #fafafa;
}

.actions {
  width: 52px;
  text-align: right;
}

.icon-button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--red);
  border-radius: var(--radius-sm);
  color: var(--red);
  background: #ffffff;
  font-weight: 900;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.icon-button:hover {
  color: #ffffff;
  background: var(--red);
}

.empty {
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.file-link {
  display: inline-grid;
  gap: 6px;
  color: var(--red);
  font-weight: 800;
  text-decoration: none;
}

.file-link img {
  width: 92px;
  height: 58px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.avatar-thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  vertical-align: middle;
}

.file-link-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.field span.field-hint {
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
}

.field-image-preview {
  width: 100%;
  max-width: 220px;
  height: 120px;
  margin-top: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.field-file-cover span.field-hint,
.field-file-plan span.field-hint {
  color: rgba(255, 255, 255, 0.78);
}

.install-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(90deg, var(--black) 0 18px, transparent 18px),
    var(--bg);
}

.auth-page {
  min-height: 100vh;
  overflow-x: hidden;
  background: #0f1115 url("../../images/intro_wallpaper.jpg") center / cover fixed no-repeat;
}

.auth-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.46);
  pointer-events: none;
}

.auth-screen {
  position: relative;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(177, 18, 38, 0.9) 0 18px, transparent 18px),
    linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(255, 255, 255, 0.14)),
    url("../../images/intro_wallpaper.jpg") center / cover no-repeat;
}

.auth-intro {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  gap: 22px;
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.78), rgba(177, 18, 38, 0.36)),
    url("../../images/intro_wallpaper.jpg") center / cover no-repeat;
  animation: introCurtain 2600ms cubic-bezier(.76, 0, .24, 1) forwards;
  pointer-events: none;
}

.auth-intro img {
  width: min(280px, 58vw);
  max-height: 280px;
  object-fit: contain;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.42));
  animation: introLogoFlight 2400ms cubic-bezier(.76, 0, .24, 1) forwards;
}

.auth-loading {
  width: min(280px, 58vw);
  margin-top: 4px;
  display: grid;
  gap: 8px;
  opacity: 0;
  animation: authLoadingIn 300ms ease 150ms forwards;
}

.auth-loading__bar {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.auth-loading__fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red-dark), var(--red));
  box-shadow: 0 0 12px rgba(177, 18, 38, 0.75);
  animation: authLoadingFill 1400ms cubic-bezier(.4, 0, .2, 1) 200ms forwards;
}

.auth-loading__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.auth-loading__label {
  font: 700 0.68rem "Segoe UI", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.72);
}

.auth-loading__pct {
  font: 800 0.92rem "Segoe UI", Arial, sans-serif;
  letter-spacing: 0.02em;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

@keyframes authLoadingIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes authLoadingFill {
  from {
    width: 0%;
  }

  to {
    width: 100%;
  }
}

.auth-panel {
  position: relative;
  overflow: hidden;
  width: min(580px, 100%);
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  animation: authPanelIn 700ms ease 1800ms both;
}

.auth-logo {
  display: block;
  width: 116px;
  height: 116px;
  margin: 0 auto 10px;
  object-fit: contain;
  animation: authLogoSettle 800ms ease 1800ms both;
}

.auth-actions {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 12px;
}

.auth-actions .button {
  flex: 1 1 180px;
}

.install-panel {
  width: min(760px, 100%);
}

.install-panel.auth-panel {
  width: min(580px, 100%);
}

.install-panel p {
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--muted);
}

.install-panel form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

@keyframes introCurtain {
  0%,
  72% {
    opacity: 1;
    visibility: visible;
  }

  100% {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes introLogoFlight {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.72) rotate(-2deg);
  }

  24% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0);
  }

  62% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-32vh) scale(0.42);
  }
}

@keyframes authPanelIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes authLogoSettle {
  from {
    opacity: 0;
    transform: translateY(-34px) scale(1.22);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes headerLogoIn {
  from {
    opacity: 0;
    transform: translate(-50%, -16px) scale(0.84);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@media (max-width: 980px) {
  .app-shell {
    flex-direction: column;
  }

  .content {
    padding: 24px;
  }

  .record-form,
  .record-form.single {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-hero-grid,
  .project-assets-grid {
    grid-template-columns: 1fr;
  }

  .project-cover,
  .project-plan,
  .field-file-cover,
  .field-file-plan {
    min-height: 280px;
  }

  .topbar-logo {
    position: static;
    width: 74px;
    height: 74px;
    margin: 0 auto;
    animation: none;
    transform: none;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .topbar-actions .button {
    width: 100%;
  }

  .record-form,
  .record-form.single {
    grid-template-columns: 1fr;
  }

  .project-main-data,
  .project-resources,
  .project-notes-grid {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 16px;
  }

  .panel {
    padding: 18px;
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  th,
  td {
    padding: 10px;
    font-size: 0.82rem;
  }

  .section-heading {
    flex-wrap: wrap;
  }
}

@media (max-width: 420px) {
  .content {
    padding: 12px;
  }

  .panel {
    padding: 14px;
    border-radius: var(--radius-sm);
  }

  .topbar-logo {
    width: 58px;
    height: 58px;
  }
}

/* Estados de link activo del sidebar vertical (ver sidebar-vertical.css) */
.sidebar__link.active {
  background: var(--bg--active);
}

.sidebar__link.active .icon svg {
  fill: var(--accent--primary);
}

.sidebar__link.active .text {
  color: var(--dark--primary);
}

/* ==========================================================================\n   MTM 2026 — panel editorial / inventario\n   Una sola superficie de fondo + tarjetas visuales inspiradas en catálogos\n   editoriales.\n   ========================================================================== */
:root {
  --bg: #e9e7e1;
  --surface: #f8f7f3;
  --surface-soft: #efede7;
  --text: #11110f;
  --muted: #77756e;
  --line: rgba(17, 17, 15, .16);
  --black: #090909;
  --red: #a9162a;
  --red-dark: #77101e;
  --shadow: 0 24px 70px rgba(12, 12, 10, .08);
  --radius: 0;
  --radius-sm: 0;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg) !important;
  color: var(--text);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
}

.app-shell { min-height: 100vh; background: var(--bg); }
.app-shell > header { position: sticky; top: 0; z-index: 30; height: 100vh; }
.content {
  max-width: none;
  width: 100%;
  padding: clamp(28px, 4vw, 64px) clamp(22px, 5vw, 76px) 90px;
}

.topbar {
  min-height: 128px;
  margin-bottom: 34px;
  padding: 0 0 30px;
  border-bottom: 1px solid var(--line);
}
.topbar > div:first-child { max-width: 900px; }
.topbar h1 {
  font-family: "Archivo Black", Inter, sans-serif;
  font-size: clamp(2.8rem, 6vw, 6.8rem);
  line-height: .88;
  letter-spacing: -.055em;
  text-transform: uppercase;
}
.topbar-subtitle { max-width: 620px; margin-top: 18px; color: #5f5d57; font-size: .95rem; }
.eyebrow { color: var(--red); letter-spacing: .18em; font-size: .68rem; font-weight: 800; }
.topbar-logo { width: 72px; height: 72px; right: 0; left: auto; top: 0; transform: none; }

.panel {
  margin-bottom: 34px;
  padding: clamp(22px, 3vw, 38px);
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(248,247,243,.78);
  box-shadow: none;
}
.section-heading { margin-bottom: 24px; }
.section-heading h2 { font-family: "Archivo Black", Inter, sans-serif; text-transform: uppercase; letter-spacing: -.025em; font-size: clamp(1.5rem, 2.6vw, 2.6rem); }
.section-heading span { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; }

.record-form { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.material-form { grid-template-columns: repeat(4, minmax(0,1fr)); }
.material-form .field:first-child { grid-column: span 2; }
.material-form .field:nth-child(4), .material-form .field:nth-child(5) { grid-column: span 2; }
.field span { color: #292824; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
input, select, textarea {
  min-height: 48px;
  border: 1px solid rgba(17,17,15,.22);
  border-radius: 0;
  background: rgba(255,255,255,.55);
  font-family: Inter, Arial, sans-serif;
}
input:focus, select:focus, textarea:focus { border-color: var(--black); outline: 3px solid rgba(169,22,42,.1); box-shadow: none; }
.button { min-height: 50px; border-radius: 0; letter-spacing: .1em; }

/* Sidebar: se siente como un panel editorial y se despliega suavemente. */
.vertical-sidebar { width: 100%; height: 100vh; }
.vertical-sidebar nav {
  width: var(--expanded);
  min-width: var(--collapsed);
  height: 100vh;
  max-height: none;
  border-radius: 0;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--bg);
  box-shadow: none;
  padding: 18px 12px;
  transition: width 480ms cubic-bezier(.16,1,.3,1);
}
.vertical-sidebar :not(:checked)~nav { width: 76px; }
.vertical-sidebar :checked~nav { width: 270px; }
.sidebar__toggle-container { height: 44px; }
.nav__toggle { border-radius: 0; }
.grupomtm-logo { width: 52px; max-inline-size: 52px; }
figure { padding: 18px 0 10px; }
.user-id { font-size: .82rem; letter-spacing: .04em; }
.user-role { font-size: .65rem; text-transform: uppercase; letter-spacing: .12em; }
.sidebar__divider { border: 0; border-top: 1px solid var(--line); margin: 8px 0 18px; }
.sidebar__group-summary, .sidebar__link { border-radius: 0; min-height: 42px; }
.sidebar__group-summary:hover, .sidebar__group-summary:focus, .sidebar__link:hover { background: rgba(17,17,15,.055); outline: 0; }
.sidebar__group[open] .sidebar__group-summary { background: rgba(169,22,42,.08); }
.sidebar__link.active { background: var(--black); color: #fff; }
.sidebar__link.active .icon svg { fill: #fff; }
.sidebar__item--heading { padding-top: 14px; }
.sidebar__item--heading { color: var(--muted); }

/* Inventario visual */
.inventory-dashboard { margin: 0 0 42px; }
.inventory-dashboard__intro {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(280px, 420px);
  gap: 32px;
  align-items: end;
  padding: 12px 0 30px;
  border-bottom: 1px solid var(--line);
}
.inventory-dashboard__intro h2 {
  margin: 0;
  font-family: "Archivo Black", Inter, sans-serif;
  font-size: clamp(2.2rem, 5vw, 5.5rem);
  line-height: .9;
  letter-spacing: -.055em;
  text-transform: uppercase;
}
.inventory-dashboard__intro p:not(.eyebrow) { max-width: 560px; margin-top: 14px; color: #68665f; line-height: 1.5; }
.catalog-search { display: grid; gap: 8px; }
.catalog-search span { font-size: .67rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.catalog-search input { height: 52px; background: var(--surface); border: 1px solid var(--black); }
.inventory-kpis { display: grid; grid-template-columns: repeat(3,1fr); border-bottom: 1px solid var(--line); margin-bottom: 34px; }
.inventory-kpis article { min-height: 130px; padding: 24px 20px 22px 0; border-right: 1px solid var(--line); }
.inventory-kpis article:not(:first-child) { padding-left: 24px; }
.inventory-kpis article:last-child { border-right: 0; }
.inventory-kpis span, .inventory-kpis small { display: block; color: var(--muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; }
.inventory-kpis strong { display: block; margin: 8px 0 2px; font-family: "Archivo Black", Inter, sans-serif; font-size: 2.5rem; letter-spacing: -.04em; }

.material-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 2px;
  background: var(--line);
  border: 1px solid var(--line);
}
.material-card {
  min-width: 0;
  background: var(--surface);
  transition: transform 300ms cubic-bezier(.16,1,.3,1), box-shadow 300ms ease;
}
.material-card:hover { position: relative; z-index: 2; transform: translateY(-5px); box-shadow: 0 20px 45px rgba(0,0,0,.13); }
.material-card__image {
  position: relative;
  display: block;
  aspect-ratio: 1.08 / 1;
  overflow: hidden;
  background: #d8d5cd;
}
.material-card__image::after { content:""; position:absolute; inset:0; background:linear-gradient(180deg,rgba(0,0,0,0) 58%,rgba(0,0,0,.18)); pointer-events:none; }
.material-card__image img { width:100%; height:100%; object-fit:cover; transition: transform 650ms cubic-bezier(.16,1,.3,1); }
.material-card:hover .material-card__image img { transform: scale(1.045); }
.material-card__tag {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  padding: 7px 9px; background: var(--surface); color: var(--black);
  font-size: .6rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
.material-card__body { padding: 22px 22px 16px; }
.material-card__code { margin: 0 0 8px; color: var(--muted); font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.material-card h3 {
  margin: 0; min-height: 2.15em; font-family: "Archivo Black", Inter, sans-serif;
  font-size: clamp(1.25rem, 2vw, 2rem); line-height: .96; letter-spacing: -.035em; text-transform: uppercase;
}
.material-card__description { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; min-height: 2.9em; margin: 12px 0 0; color: #69665f; font-size: .82rem; line-height: 1.45; }
.material-card__meta { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-top: 22px; padding-top: 14px; border-top:1px solid var(--line); font-size:.7rem; font-weight:700; text-transform:uppercase; letter-spacing:.08em; }
.stock-badge { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; }
.stock-badge i { width:7px; height:7px; display:block; border-radius:50%; background:#111; }
.stock-badge.is-low i { background:#b47712; }
.stock-badge.is-empty i { background:var(--red); }
.material-card__footer { display:flex; justify-content:space-between; align-items:center; gap:12px; padding: 14px 22px 20px; color:var(--muted); font-size:.62rem; text-transform:uppercase; letter-spacing:.1em; }
.material-card__footer form { margin:0; }
.material-card__footer button { padding:0; border:0; background:none; color:var(--muted); font:inherit; cursor:pointer; text-transform:uppercase; letter-spacing:inherit; }
.material-card__footer button:hover { color:var(--red); }
.material-empty { grid-column:1/-1; padding:80px 20px; text-align:center; background:var(--surface); color:var(--muted); }
.generic-records-panel { display:none; }

@media (max-width: 1100px) {
  .material-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .inventory-dashboard__intro { grid-template-columns: 1fr; }
  .material-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .material-form .field:first-child, .material-form .field:nth-child(4), .material-form .field:nth-child(5) { grid-column: span 1; }
}
@media (max-width: 760px) {
  .app-shell > header { position: fixed; inset:0 auto 0 0; }
  .content { padding: 24px 18px 60px 94px; }
  .topbar-logo { display:none; }
  .topbar h1 { font-size: clamp(2.5rem, 15vw, 5rem); }
  .inventory-kpis { grid-template-columns:1fr; }
  .inventory-kpis article, .inventory-kpis article:not(:first-child) { border-right:0; border-bottom:1px solid var(--line); padding:16px 0; min-height:auto; }
  .inventory-kpis article:last-child { border-bottom:0; }
  .material-grid { grid-template-columns:1fr; }
  .material-form { grid-template-columns:1fr; }
  .material-form .field:first-child, .material-form .field:nth-child(4), .material-form .field:nth-child(5) { grid-column:auto; }
}
