:root {
  --page: #f4f7f2;
  --surface: #ffffff;
  --surface-2: #edf3ea;
  --ink: #1f2b22;
  --muted: #68736a;
  --line: #d9e1d5;
  --accent: #2f7d51;
  --accent-2: #a7592d;
  --focus: rgba(47, 125, 81, 0.22);
  --danger: #a13f32;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  padding-bottom: 30px;
}

body.modal-open {
  overflow: hidden;
}

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

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.login-screen {
  display: grid;
  min-height: calc(100vh - 62px);
  place-items: center;
  padding: 28px;
}

.login-card {
  display: grid;
  gap: 13px;
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 30px;
  box-shadow: 0 24px 70px rgba(43, 57, 45, 0.14);
}

.login-card img {
  width: 180px;
  max-height: 100px;
  object-fit: contain;
  justify-self: center;
}

.login-card h1 {
  margin-bottom: 0;
  text-align: center;
}

.login-card p {
  color: var(--muted);
  text-align: center;
}

.login-card label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-weight: 800;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  width: 100%;
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--accent);
  background: var(--surface-2);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle .eye-closed {
  display: none;
}

.password-toggle.is-visible .eye-open {
  display: none;
}

.password-toggle.is-visible .eye-closed {
  display: block;
}

.sidebar {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #183222 0%, #203528 54%, #17291f 100%);
  color: #f7fbf4;
  padding: 24px 16px;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
  padding: 0 2px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: #dfe9d7;
  color: #203528;
  font-weight: 800;
}

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 10px;
  background: #f7fbf4;
  padding: 4px;
}

.brand-fallback {
  display: none;
}

.brand small {
  display: block;
  color: #b9c9bb;
  margin-top: 3px;
}

.brand strong {
  letter-spacing: 0;
}

.menu {
  display: grid;
  gap: 7px;
}

.user-panel {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-panel span {
  color: #dfe9d7;
  font-size: 13px;
  font-weight: 800;
}

.user-panel .ghost-button {
  width: 100%;
  min-height: 34px;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 0 10px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #eaf1e8;
  text-align: left;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 600;
}

.menu-item.active,
.menu-item:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.menu-item.active {
  box-shadow: inset 3px 0 0 #9dcc8f;
}

.menu-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.12);
  color: #dfe9d7;
  line-height: 1;
  flex: 0 0 auto;
}

.menu-icon svg {
  width: 18px;
  height: 18px;
}

.menu-icon path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.menu-item.active .menu-icon,
.menu-item:hover .menu-icon {
  background: #dfe9d7;
  color: #203528;
}

.workspace {
  padding: 28px 32px;
  overflow: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: 28px;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.topbar p,
.hint {
  color: var(--muted);
}

.edit-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hidden {
  display: none !important;
}

#homeScreen {
  padding: 16px 18px;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
}

.home-hero {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  text-align: left;
  gap: 30px;
  padding: 2px 10px 12px;
  color: #1c4a30;
}

.home-hero-logo {
  width: min(210px, 38vw);
  max-height: 130px;
  object-fit: contain;
  margin-bottom: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.home-hero-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.home-hero h2 {
  margin: 0 0 6px;
  font-size: 26px;
  color: #1c4a30;
}

.home-clock {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.home-clock strong {
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 1px;
  color: #1c4a30;
  font-variant-numeric: tabular-nums;
}

.home-clock span {
  border: 1px solid rgba(28, 74, 48, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  color: #1c4a30;
  padding: 7px 18px;
  font-size: 14px;
  font-weight: 700;
  text-transform: capitalize;
}

.weather-card {
  margin-top: 18px;
  border: 1px solid rgba(47, 125, 81, 0.45);
  border-radius: 16px;
  background: rgba(238, 246, 235, 0.7);
  padding: 22px 24px;
  box-shadow: 0 22px 48px rgba(43, 57, 45, 0.12);
}

.weather-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.weather-card-header h3 {
  margin: 0;
  font-size: 22px;
}

.weather-location {
  color: var(--muted);
  font-size: 13px;
}

.weather-status {
  color: var(--muted);
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  background: var(--surface-2);
}

.weather-today {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 18px 24px;
  border-radius: 14px;
  color: #ffffff;
  background: linear-gradient(120deg, rgba(45, 108, 180, 0.7), rgba(75, 144, 214, 0.7) 60%, rgba(111, 177, 232, 0.7));
  box-shadow: 0 16px 36px rgba(45, 108, 180, 0.28);
}

.weather-today.sunny {
  background: linear-gradient(120deg, rgba(217, 142, 4, 0.7), rgba(242, 167, 27, 0.7) 55%, rgba(247, 195, 76, 0.7));
  box-shadow: 0 16px 36px rgba(217, 142, 4, 0.28);
}

.weather-today-icon {
  font-size: 56px;
  line-height: 1;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.2));
}

.weather-today-main strong {
  display: block;
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
}

.weather-today-main span {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  font-weight: 700;
  opacity: 0.92;
}

.weather-today-meta {
  display: flex;
  gap: 12px;
  margin-left: auto;
  flex-wrap: wrap;
}

.weather-today-meta div {
  min-width: 110px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 11px 14px;
  text-align: center;
}

.weather-today-meta small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.85;
}

.weather-today-meta strong {
  display: block;
  margin-top: 3px;
  font-size: 20px;
  font-weight: 800;
}

.weather-days {
  display: grid;
  grid-template-columns: repeat(6, minmax(126px, 1fr));
  gap: 14px;
}

.weather-day {
  border: 1px solid rgba(47, 125, 81, 0.38);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(223, 238, 221, 0.7), rgba(199, 224, 196, 0.7));
  padding: 15px 10px 14px;
  text-align: center;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.weather-day:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 26px rgba(43, 57, 45, 0.14);
}

.weather-day.rain-alert {
  border-color: rgba(45, 108, 180, 0.45);
  background: linear-gradient(180deg, rgba(216, 235, 255, 0.7), rgba(173, 213, 249, 0.7));
}

.weather-day-label {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--muted);
  text-transform: capitalize;
}

.weather-day-icon {
  display: block;
  margin: 5px 0 3px;
  font-size: 32px;
  line-height: 1;
}

.weather-day-temp {
  display: block;
  margin: 2px 0 4px;
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
}

.weather-day-temp small {
  color: var(--muted);
  font-weight: 600;
}

.weather-day-rain {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 700;
  color: #2d6cb4;
  background: rgba(45, 108, 180, 0.1);
  border-radius: 999px;
  padding: 3px 9px;
}

.home-quick {
  margin-top: 18px;
  border: 1px solid rgba(47, 125, 81, 0.42);
  border-radius: 16px;
  background: rgba(238, 246, 235, 0.7);
  padding: 20px 24px 22px;
  box-shadow: 0 18px 40px rgba(43, 57, 45, 0.1);
}

.home-quick h3 {
  margin: 0 0 14px;
  font-size: 20px;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(7, minmax(100px, 1fr));
  gap: 14px;
}

.quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(223, 238, 221, 0.7);
  padding: 16px 10px;
  min-height: 96px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.quick-link span {
  font-size: 30px;
  line-height: 1;
}

.quick-link:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 14px 26px rgba(47, 125, 81, 0.18);
}

.home-animate .home-hero-logo {
  animation: homeLogoEntrance 850ms ease both;
}

.home-animate .home-hero h2,
.home-animate .home-clock {
  animation: homeTextEntrance 720ms ease 120ms both;
}

.home-animate .weather-card {
  animation: homeWeatherEntrance 760ms ease 220ms both;
}

.home-animate .home-quick {
  animation: homeWeatherEntrance 760ms ease 320ms both;
}

@keyframes homeLogoEntrance {
  from {
    opacity: 0;
    transform: translateY(-14px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes homeTextEntrance {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes homeWeatherEntrance {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.permission-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
}

.permission-grid input {
  width: auto;
  min-height: auto;
}

.compact-list {
  margin: 0 18px 18px;
}

.app-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 260px;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: #1b3425;
  color: #f7fbf4;
  padding: 4px 18px;
  box-shadow: none;
}

.footer-brand,
.footer-support {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.08);
}

.sync-status strong {
  color: #ffffff;
  font-size: 11px;
}

.sync-status span {
  color: #dfe9d7;
  font-size: 11px;
}

.sync-status.offline {
  background: rgba(180, 106, 33, 0.26);
}

.sync-status.pending {
  background: rgba(47, 125, 81, 0.22);
}

.footer-brand strong,
.footer-support strong {
  color: #ffffff;
  font-size: 11px;
}

.footer-brand span,
.footer-support span {
  color: #dfe9d7;
  font-size: 11px;
}

.primary-button,
.ghost-button {
  min-height: 42px;
  border-radius: 7px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 700;
}

.primary-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
}

.ghost-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.saved-products {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(43, 57, 45, 0.08);
}

.product-form {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(24, 34, 27, 0.48);
  padding: 18px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-backdrop.stacked {
  z-index: 45;
}

.modal-window {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1120px, 100%);
  max-height: min(92vh, 860px);
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(14, 24, 16, 0.32);
}

.modal-window.wide {
  width: min(1280px, 100%);
}

.modal-window.small {
  width: min(760px, 100%);
}

.launch-window .modal-header {
  background: var(--accent);
  color: #ffffff;
}

.launch-window .modal-header p {
  color: #ffffff;
}

.launch-window .icon-button {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.launch-window .entry-panel {
  background: #f3f5f2;
}

.launch-window input,
.launch-window select,
.launch-window textarea {
  background: #eef1ed;
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
}

.modal-header {
  border-bottom: 1px solid var(--line);
}

.launch-header {
  background: #246843;
  color: white;
}

.launch-header p {
  color: #ffffff;
}

.modal-logo {
  width: 92px;
  height: 58px;
  object-fit: contain;
  border-radius: 6px;
  background: white;
  padding: 4px;
}

.modal-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 130%;
  line-height: 1.35;
}

.modal-header h2 {
  margin: 0;
  font-size: 130%;
  line-height: 1.2;
}

.launch-window .modal-header h2,
.launch-window .modal-header p,
.launch-header h2,
.launch-header p {
  color: #ffffff;
}

.modal-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: #f8faf7;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.modal-window .product-form {
  min-height: 0;
  overflow: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.tab {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  white-space: nowrap;
  cursor: pointer;
}

.tab.active {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 700;
}

.tab-panel {
  display: none;
  padding: 20px;
}

.tab-panel.active {
  display: block;
}

.entry-panel {
  display: block;
  padding: 20px;
}

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

label {
  display: grid;
  gap: 7px;
  color: #3f4b42;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  padding: 9px 10px;
  outline: none;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--focus);
}

input[readonly] {
  background: #f5f7f4;
  color: #4f5b52;
}

.span-2 {
  grid-column: span 2;
}

.autocomplete-wrap {
  position: relative;
}

.suggestions {
  display: none;
  position: absolute;
  z-index: 10;
  top: 68px;
  right: 0;
  left: 0;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 16px 40px rgba(31, 43, 34, 0.14);
}

.suggestions.open {
  display: block;
}

.suggestion {
  width: 100%;
  border: 0;
  background: white;
  text-align: left;
  padding: 12px;
  cursor: pointer;
}

.suggestion:hover,
.suggestion.active {
  background: var(--surface-2);
}

.suggestion strong {
  display: block;
}

.suggestion small {
  color: var(--muted);
}

.photo-layout {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(260px, 1fr);
  gap: 20px;
  align-items: start;
}

.photo-preview {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.photo-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-fields {
  display: grid;
  gap: 10px;
}

.photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.suppliers-filter {
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  align-items: end;
}

.entry-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 12px;
}

.entry-launch-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quick-inline-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid rgba(47, 125, 81, 0.35);
  border-radius: 8px;
  background: #eef6eb;
  padding: 14px;
}

.entry-items-header.compact {
  margin-bottom: 0;
}

.inline-panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-panel-actions .hint {
  margin-right: auto;
}

.entry-items-header h3 {
  margin: 0;
  font-size: 17px;
}

.entry-items-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.entry-items-list {
  display: grid;
  gap: 12px;
}

.field-with-action {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 8px;
}

.compact-button {
  min-height: 42px;
  white-space: nowrap;
}

.action-supplier {
  border-color: #8d5b00;
  background: #ffe29a;
  color: #3b2600;
}

.action-product {
  border-color: #145f91;
  background: #c8eaff;
  color: #073a5a;
}

.action-client {
  border-color: #7d3f12;
  background: #ffd6b8;
  color: #4b2106;
}

.action-client,
.action-product,
.action-supplier {
  box-shadow: 0 0 0 3px rgba(47, 125, 81, 0.08), 0 8px 18px rgba(31, 43, 34, 0.08);
  font-weight: 900;
}

.action-launch {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.entry-item-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.entry-item-card:first-child {
  border-color: rgba(47, 125, 81, 0.5);
  box-shadow: 0 0 0 3px rgba(47, 125, 81, 0.08);
}

.entry-item-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.entry-item-top .product-lookup {
  grid-column: 1 / -1;
}

.entry-item-product-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.entry-product-summary {
  display: grid;
  gap: 3px;
  min-height: 42px;
  align-content: center;
}

.entry-product-summary span {
  color: var(--muted);
  font-size: 13px;
}

.entry-item-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 14px;
  align-items: end;
}

.entry-item-grid label {
  min-width: 0;
}

.entry-item-notes {
  grid-column: span 2;
}

.entry-item-total-box {
  display: grid;
  gap: 4px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.entry-item-total-box strong {
  color: var(--ink);
  font-size: 15px;
}

.entry-totals {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.entry-totals span {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8faf7;
  padding: 8px 10px;
  color: var(--muted);
}

.entry-totals strong {
  color: var(--ink);
}

.saved-products {
  margin-top: 18px;
  overflow: hidden;
}

.subtabs {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  border-bottom: 3px solid var(--accent);
}

.subtab {
  min-height: 40px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #e8ece7;
  color: #4f5b52;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 800;
}

.subtab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.entry-tab-panel,
.stock-tab-panel,
.sales-tab-panel,
.quote-tab-panel,
.purchase-tab-panel,
.report-panel {
  display: none;
  margin-top: 0;
  border-top-left-radius: 0;
}

.entry-tab-panel.active,
.stock-tab-panel.active,
.sales-tab-panel.active,
.quote-tab-panel.active,
.purchase-tab-panel.active,
.report-panel.active {
  display: block;
}

.report-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 18px 0;
}

.report-indicators {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  padding: 16px 18px;
}

.report-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf6;
  padding: 12px;
}

.report-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.report-card strong {
  display: block;
  margin-top: 7px;
  color: var(--accent);
  font-size: 18px;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  padding: 0 18px 18px;
}

.chart-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.chart-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 2fr minmax(64px, auto);
  gap: 9px;
  align-items: center;
  margin: 8px 0;
  font-size: 12px;
}

.bar-row div {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.print-body {
  padding: 24px;
  background: white;
}

.print-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 12px;
}

.print-header img {
  width: 140px;
  max-height: 80px;
  object-fit: contain;
}

.print-header h1 {
  margin: 0 0 6px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.section-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
}

th {
  background: #f8faf7;
  color: #556058;
  font-size: 12px;
  text-transform: uppercase;
}

.product-thumb {
  width: 54px;
  height: 42px;
  border-radius: 7px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: var(--surface-2);
}

.row-actions {
  display: flex;
  gap: 8px;
}

.small-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  padding: 0 10px;
  cursor: pointer;
  font-weight: 700;
}

.small-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.small-button.warning:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.small-button.danger {
  border-color: #c84f3c;
  color: #a13f32;
  background: #fff0ed;
}

.small-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.active {
  background: #e5f3e8;
  color: #25673e;
}

.status-pill.inactive {
  background: #f6e8e4;
  color: var(--danger);
}

tr.inactive-row {
  color: #778078;
  background: #faf7f6;
}

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

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    padding: 16px;
  }

  .menu {
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    overflow-x: auto;
  }

  .workspace {
    padding: 18px;
  }

  .weather-days {
    grid-template-columns: repeat(3, minmax(90px, 1fr));
  }

  .quick-links {
    grid-template-columns: repeat(4, minmax(90px, 1fr));
  }

  .home-hero {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .home-hero-text {
    align-items: center;
  }

  .topbar,
  .photo-layout {
    grid-template-columns: 1fr;
    display: grid;
  }

  .topbar-actions {
    justify-content: start;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .entry-item-top {
    grid-template-columns: 1fr;
  }

  .field-with-action {
    grid-template-columns: 1fr;
  }

  .entry-item-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .entry-item-total-box {
    grid-column: span 2;
  }

  .filters-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 620px) {
  .workspace {
    padding: 12px;
  }

  h1 {
    font-size: 23px;
  }

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

  .span-2 {
    grid-column: auto;
  }

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

  .entry-item-grid,
  .filters-grid {
    grid-template-columns: 1fr;
  }

  .weather-days,
  .quick-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .weather-today {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .weather-today-meta {
    margin-left: 0;
  }

  .entry-item-total-box {
    grid-column: auto;
  }

  .app-footer {
    left: 0;
    align-items: center;
    flex-direction: row;
    gap: 8px;
    min-height: 30px;
  }
}
