/*
 * Compact density styles for forms and tables in the responsive shell.
 */

body.app-responsive input:not([type='checkbox']):not([type='radio']):not([type='range']),
body.app-responsive select,
body.app-responsive textarea,
body.app-responsive .button,
body.app-responsive button {
  min-height: 32px;
  padding: var(--space-6) clamp(var(--space-8), 1.5vw, var(--space-16));
  border-radius: 8px;
  font-size: clamp(13px, 0.95vw, 15px);
}

body.app-responsive textarea {
  min-height: clamp(96px, 18vh, 220px);
}

body.app-responsive select {
  width: 100%;
  max-width: 100%;
  background-image: linear-gradient(135deg, rgba(75, 62, 50, 0.08), rgba(75, 62, 50, 0));
}

body.app-responsive input[type='checkbox'],
body.app-responsive input[type='radio'] {
  width: auto;
  min-height: auto;
}

body.app-responsive fieldset {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: clamp(var(--space-12), 2vw, var(--space-24));
  margin: 0;
}

body.app-responsive legend {
  padding-inline: var(--space-8);
  font-weight: 600;
}

.app-shell--responsive #content table.sortable thead th,
.app-shell--responsive #content .table-wrap > table thead th {
  padding: var(--space-12) clamp(var(--space-12), 2vw, var(--space-20));
  font-size: clamp(12px, 0.9vw, 15px);
  background: rgba(241, 245, 255, 0.95);
}

.app-shell--responsive #content table.sortable tbody td,
.app-shell--responsive #content .table-wrap > table tbody td {
  padding: var(--space-8) clamp(var(--space-12), 2vw, var(--space-16));
  font-size: clamp(12px, 0.9vw, 15px);
  line-height: 1.4;
}

.app-shell--responsive #content table.sortable tbody tr:nth-child(even) {
  background: rgba(148, 163, 184, 0.08);
}

.app-shell--responsive #content table.sortable tbody tr:hover {
  background: rgba(59, 130, 246, 0.12);
}

.app-shell--responsive #content table.sortable tbody td > a,
.app-shell--responsive #content table.sortable tbody td > button {
  gap: var(--space-6);
}

.app-shell--responsive #content .table-wrap {
  margin-inline: auto;
}

body.app-responsive #content {
  gap: clamp(var(--space-12), 2vw, var(--space-24));
}

body.app-responsive #content_task,
body.app-responsive div#select {
  height: 250px;
  max-height: 250px;
  overflow: auto;
  padding: var(--space-4);
}

body.app-responsive #content_task {
  height: 350px;
  max-height: 350px;
}

body.app-responsive #mainmenu {
  width: clamp(20rem, 70vw, 54rem);
  max-width: 100%;
  min-height: 30px;
}

body.app-responsive #dropdown {
  width: auto;
  max-width: 100%;
}

body.app-responsive .nav-tabs a {
  min-height: 32px;
}

body.app-responsive .button,
body.app-responsive a.button {
  line-height: 1.3;
}

body.app-responsive table caption {
  font-size: clamp(12px, 0.85vw, 15px);
  padding-bottom: var(--space-8);
}

body.app-responsive #content .virtual-table-wrapper {
  max-height: none;
}

body.app-responsive #content table.sortable thead th,
body.app-responsive #content table.sortable tbody td {
  /* Removed white-space: nowrap to allow multi-line headers */
  text-overflow: ellipsis;
}

body.app-responsive #content table.sortable tbody td {
  white-space: nowrap; /* Keep nowrap for data cells only */
  overflow: hidden;
}

body.app-responsive #content .table-wrap,
body.app-responsive #content .virtual-table-wrapper {
  scrollbar-color: rgba(148, 163, 184, 0.6) transparent;
  scrollbar-width: thin;
}

body.app-responsive #content .table-wrap::-webkit-scrollbar,
body.app-responsive #content .virtual-table-wrapper::-webkit-scrollbar {
  height: 8px;
}

body.app-responsive #content .table-wrap::-webkit-scrollbar-thumb,
body.app-responsive #content .virtual-table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.6);
  border-radius: 999px;
}
