*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f7fb;
  color: #1f2933;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 2rem;
  background: #16a34a;
  color: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
}

.app-header-logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.app-header-logo {
  display: block;
  height: 10rem;
  width: auto;
  object-fit: contain;
}

.app-header-text {
  min-width: 0;
}

.app-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
}

.app-header p {
  margin: 0;
  opacity: 0.9;
}

.header-user {
  opacity: 0.9;
}

/* Login page */
.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-form {
  width: 100%;
  max-width: 320px;
  padding: 2rem;
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
}

.login-form h2 {
  margin: 0 0 1.25rem;
  font-size: 1.35rem;
  color: #1f2933;
}

.login-field {
  margin-bottom: 1rem;
}

.login-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  color: #475569;
}

.login-field input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  font-size: 1rem;
}

.login-form button {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.6rem 1rem;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.login-form button:hover {
  background: #15803d;
}

.login-message {
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #475569;
}

.login-message--error {
  color: #dc2626;
}

.app-main {
  flex: 1;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
  max-height: calc(100vh - 96px);
}

.sidebar {
  background: #f0f4ff;
  border-right: 1px solid #d2dbf0;
  padding: 1rem;
  overflow-y: auto;
}

.sidebar h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.conveyor-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.finish-audits-btn {
  margin-top: 1rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 0.5rem;
  background: #16a34a;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}
.finish-audits-btn:hover {
  background: #15803d;
}

.finish-audits-confirm-message {
  margin: 0 0 1.25rem;
  color: #1f2933;
  line-height: 1.5;
}

.finish-audits-confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.finish-audits-confirm-actions button {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
}

.finish-audits-confirm-cancel {
  background: #e2e8f0;
  color: #475569;
}

.finish-audits-confirm-cancel:hover {
  background: #cbd5e1;
}

.finish-audits-confirm-complete {
  background: #16a34a;
  color: #fff;
}

.finish-audits-confirm-complete:hover {
  background: #15803d;
}

.conveyor-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.conveyor-group-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: none;
  border-radius: 0.5rem;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  text-align: left;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.conveyor-group-btn--green { background: #16a34a !important; color: #fff !important; }
.conveyor-group-btn--green:hover { background: #15803d !important; color: #fff !important; }
.conveyor-group-btn--yellow { background: #facc15 !important; color: #1f2933 !important; }
.conveyor-group-btn--yellow:hover { background: #eab308 !important; color: #1f2933 !important; }
.conveyor-group-btn--orange { background: #ea580c !important; color: #fff !important; }
.conveyor-group-btn--orange:hover { background: #c2410c !important; color: #fff !important; }
.conveyor-group-btn--red { background: #dc2626 !important; color: #fff !important; }
.conveyor-group-btn--red:hover { background: #b91c1c !important; color: #fff !important; }

.conveyor-group-chevron {
  font-size: 0.7rem;
  opacity: 0.9;
}

.conveyor-group-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-left: 0.25rem;
  border-left: 2px solid #e2e8f0;
  margin-left: 0.25rem;
}

.conveyor-group-list[hidden] {
  display: none !important;
}

.conveyor-item {
  border: none;
  border-radius: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  font-size: 0.95rem;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.conveyor-item:hover {
  background: #e5efff;
  transform: translateY(-1px);
}

.conveyor-item:active {
  transform: translateY(0);
}

.conveyor-item--green { background: #16a34a !important; color: #fff; }
.conveyor-item--green:hover { background: #15803d !important; color: #fff; }
.conveyor-item--yellow { background: #facc15 !important; color: #1f2933; }
.conveyor-item--yellow:hover { background: #eab308 !important; color: #1f2933; }
.conveyor-item--orange { background: #ea580c !important; color: #fff; }
.conveyor-item--orange:hover { background: #c2410c !important; color: #fff; }
.conveyor-item--red { background: #dc2626 !important; color: #fff; }
.conveyor-item--red:hover { background: #b91c1c !important; color: #fff; }

.condition-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.condition-btn {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.condition-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.condition-btn.selected {
  border-color: #1f2933;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
}

.condition-btn--green { background: #16a34a; color: #fff; }
.condition-btn--yellow { background: #facc15; color: #1f2933; }
.condition-btn--orange { background: #ea580c; color: #fff; }
.condition-btn--red { background: #dc2626; color: #fff; }

.condition-pill {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.condition-pill--green { background: #16a34a; color: #fff; }
.condition-pill--yellow { background: #facc15; color: #1f2933; }
.condition-pill--orange { background: #ea580c; color: #fff; }
.condition-pill--red { background: #dc2626; color: #fff; }

.content {
  padding: 1.25rem 1.75rem;
  overflow-y: auto;
}

.details-title-wrap {
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.details-title-wrap--neutral {
  background: #e2e8f0;
  color: #475569;
}

.details-title-wrap--green {
  background: #16a34a;
  color: #fff;
}

.details-title-wrap--yellow {
  background: #facc15;
  color: #1f2933;
}

.details-title-wrap--orange {
  background: #ea580c;
  color: #fff;
}

.details-title-wrap--red {
  background: #dc2626;
  color: #fff;
}

.details-title-wrap h2 {
  margin: 0;
  font-size: inherit;
}

.details h2 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.log-form {
  background: #ffffff;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  margin-bottom: 1.25rem;
}

.field-group {
  margin-bottom: 0.9rem;
}

.field-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.last-log-preview-wrap {
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: #f1f5f9;
  border-radius: 0.5rem;
  border-left: 3px solid #64748b;
}

.last-log-preview-label {
  margin: 0 0 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}

.last-log-preview {
  font-size: 0.9rem;
  color: #334155;
  white-space: nowrap;
  overflow-x: auto;
  margin-bottom: 0.5rem;
}

.copy-last-log-btn {
  display: block;
  margin-left: auto;
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
  border-radius: 0.5rem;
  border: 1px solid #94a3b8;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font-weight: 500;
}

.copy-last-log-btn:hover {
  background: #e2e8f0;
}

.collapsible-parts-wrap {
  margin-bottom: 0.9rem;
}

.collapsible-parts-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  font-size: 1rem;
  text-align: left;
  border: 1px solid #c4cfeb;
  border-radius: 0.5rem;
  background: #f8fafc;
  color: #1f2933;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.collapsible-parts-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.collapsible-parts-btn::after {
  content: '';
  margin-left: auto;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.collapsible-parts-wrap.is-open .collapsible-parts-btn::after,
.collapsible-parts-list-wrap.is-open .collapsible-parts-btn::after {
  transform: rotate(-135deg);
}

.collapsible-parts-content {
  margin-top: 0.5rem;
}

.collapsible-parts-content[hidden] {
  display: none;
}

.parts-list {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.part-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
}

.part-item-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.part-item-desc {
  font-weight: 500;
  color: #1f2933;
}

.part-item-mfg,
.part-item-supplier {
  font-size: 0.9rem;
  color: #64748b;
}

.part-item-actions {
  display: flex;
  gap: 0.35rem;
}

textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid #c4cfeb;
  font: inherit;
  resize: vertical;
  min-height: 3rem;
}

textarea:focus {
  outline: none;
  border-color: #1f5eff;
  box-shadow: 0 0 0 2px rgba(31, 94, 255, 0.12);
}

button {
  font: inherit;
}

button[type='button']:not(.condition-btn):not(.conveyor-item),
button[type='submit'] {
  border-radius: 0.5rem;
  border: none;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

button[type='button']:not(.condition-btn):not(.conveyor-item) {
  background: #e5efff;
  color: #12355b;
}

button[type='button']:not(.condition-btn):not(.conveyor-item):hover:not(:disabled) {
  background: #d5e4ff;
}

button[type='submit'] {
  background: #1f5eff;
  color: #fff;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.16);
}

button[type='submit']:hover {
  background: #1848c0;
}

button:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

.condition-save-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.condition-and-save-row .form-actions {
  margin-top: 0;
  margin-left: auto;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.report-actions {
  margin-bottom: 1.25rem;
}

.report-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: none;
  background: #ea580c;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}

.report-btn:hover {
  background: #c2410c;
}

.report-actions .hint {
  margin-top: 0.35rem;
  margin-bottom: 0;
}

/* Reports page */
.app-header--reports p {
  margin-top: 0.25rem;
}

.reports-main {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-y: auto;
}

.reports-content {
  max-width: 560px;
}

.reports-content h2 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.report-card {
  background: #fff;
  border-radius: 0.5rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  margin-bottom: 1rem;
}

.report-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.report-description {
  color: #475569;
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.report-card .report-btn {
  margin-top: 0.25rem;
}

.report-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.logs-section h3 {
  margin-top: 0;
}

.logs-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.log-card {
  background: #ffffff;
  border-radius: 0.5rem;
  padding: 0.75rem 0.9rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  border-left: 3px solid #1f5eff;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.35rem;
}

.log-header h4 {
  margin: 0;
  font-size: 1rem;
}

.log-date {
  font-size: 0.8rem;
  color: #6b7280;
}

.log-field {
  margin: 0.15rem 0;
}

.hint {
  font-size: 0.85rem;
  color: #6b7280;
}

.error {
  color: #b91c1c;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .app-main {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid #d2dbf0;
    max-height: 220px;
  }
}

/* Settings page */
.header-link {
  color: #fff;
  text-decoration: underline;
}

.header-link:hover {
  text-decoration: none;
}

.app-header--manage p {
  margin-top: 0.25rem;
}

.manage-main {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-y: auto;
}

.manage-content {
  max-width: 560px;
}

.manage-content h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.manage-form--checkbox {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.manage-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 500;
}

.manage-checkbox-label input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
}

.manage-hint--inline {
  margin-bottom: 0;
  margin-top: 0;
  font-size: 0.9rem;
}

.manage-hint {
  color: #475569;
  margin-bottom: 1.5rem;
}

.manage-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.manage-form-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.manage-form-row input {
  flex: 1;
  min-width: 120px;
  padding: 0.5rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid #c4cfeb;
  font: inherit;
}

.manage-form-row input:focus {
  outline: none;
  border-color: #1f5eff;
}

.manage-form-row button {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: none;
  background: #16a34a;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.manage-form-row button:hover {
  background: #15803d;
}

.manage-label-inline {
  font-weight: 600;
  margin: 0;
}

.manage-form-row select {
  padding: 0.4rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid #c4cfeb;
  font: inherit;
  min-width: 100px;
}

.manage-section-title {
  margin-top: 2.5rem;
  margin-bottom: 0.5rem;
}

.group-list-section {
  margin-top: 1rem;
}

.group-list-section h3 {
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.manage-group-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.manage-message {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #16a34a;
}

.manage-message--error {
  color: #dc2626;
}

.conveyor-list-section {
  margin-top: 2rem;
}

.conveyor-list-section h3 {
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.manage-conveyor-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.manage-conveyor-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  flex-wrap: wrap;
}

.manage-conveyor-name {
  font-weight: 500;
  min-width: 80px;
}

.manage-conveyor-group-label {
  font-size: 0.85rem;
  color: #64748b;
  min-width: 50px;
}

.manage-group-select {
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
  border-radius: 0.5rem;
  border: 1px solid #c4cfeb;
  margin-left: auto;
}

.manage-delete-btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
  border-radius: 0.5rem;
  border: 1px solid #fecaca;
  background: #fff;
  color: #dc2626;
  cursor: pointer;
  font-weight: 500;
}

.manage-delete-btn:hover {
  background: #fef2f2;
}

.manage-edit-btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
  border-radius: 0.5rem;
  border: 1px solid #94a3b8;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font-weight: 500;
}

.manage-edit-btn:hover {
  background: #e2e8f0;
}

.order-buttons {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.order-btn {
  padding: 0.15rem 0.35rem;
  font-size: 0.75rem;
  line-height: 1;
  border-radius: 0.5rem;
  border: 1px solid #94a3b8;
  background: #fff;
  color: #475569;
  cursor: pointer;
}

.order-btn:hover:not(:disabled) {
  background: #e2e8f0;
}

.order-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.email-settings-form .manage-form {
  margin-bottom: 0.9rem;
}

.email-settings-subheading {
  margin-top: 1.25rem;
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.email-settings-form .manage-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.email-settings-form input[type="email"],
.email-settings-form input[type="text"] {
  width: 100%;
  max-width: 400px;
  padding: 0.5rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid #c4cfeb;
  font: inherit;
}

.email-settings-form textarea {
  width: 100%;
  max-width: 500px;
  padding: 0.5rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid #c4cfeb;
  font: inherit;
  resize: vertical;
}

.email-recipients-section {
  margin-top: 1.5rem;
}

.email-recipients-section h3 {
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.report-send-email-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.report-send-email-section h4 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.report-recipients-list {
  margin: 0.5rem 0 0.75rem;
  max-height: 200px;
  overflow-y: auto;
}

.report-recipient-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
}

.report-recipient-option input {
  margin: 0;
}

.report-send-email-section .report-btn {
  margin-top: 0.25rem;
}

/* Status page */
.home-main {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

.home-view {
  max-width: 900px;
  margin: 0 auto;
}

.home-view--hidden {
  display: none !important;
}

.home-heading {
  margin: 0 0 1.25rem;
  font-size: 1.35rem;
  color: #1f2933;
}

.home-back-btn {
  margin-bottom: 1rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #fff;
  color: #475569;
  font-size: 0.9rem;
  cursor: pointer;
}

.home-back-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.home-groups-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  width: 100%;
}

.home-group-box,
.home-conveyor-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  padding: 1.25rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.home-group-box:hover,
.home-conveyor-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}

.home-group-box--expanded {
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.35);
}

.home-conveyors-collapse {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
}

.home-conveyors-collapse[hidden] {
  display: none !important;
}

.home-conveyors-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 700px) {
  .home-groups-grid {
    grid-template-columns: 1fr;
  }
  .home-conveyors-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Log entries modal */
.log-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.log-modal[hidden] {
  display: none !important;
}

.log-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}

.log-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
}

.log-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.log-modal-title {
  margin: 0;
  font-size: 1.1rem;
  color: #1f2933;
}

.log-modal-close {
  padding: 0.25rem 0.5rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
}

.log-modal-close:hover {
  color: #1f2933;
}

.log-modal-content {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

body.log-modal-open {
  overflow: hidden;
}

