/* CardSystem-style responsive list cards. Desktop tables remain unchanged. */
@media (max-width: 760px) {
  .main main {
    padding: 12px;
  }

  .page-head {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 14px;
  }

  .page-head > button {
    width: 100%;
  }

  .panel {
    padding: 13px;
    margin-bottom: 12px;
    border-radius: 11px;
    box-shadow: 0 3px 12px rgba(15, 23, 42, .04);
  }

  .panel-head {
    margin-bottom: 12px;
  }

  .toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 12px !important;
  }

  .toolbar input,
  .toolbar select {
    width: 100%;
    min-width: 0;
  }

  .table-wrap {
    overflow: visible;
  }

  .mobile-card-table,
  .mobile-card-table tbody {
    display: block;
    width: 100%;
  }

  .mobile-card-table thead {
    display: none;
  }

  .mobile-card-table tbody {
    display: grid;
    gap: 10px;
  }

  .mobile-card-table .mobile-table-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
    overflow: hidden;
    margin: 0;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(15, 23, 42, .04);
  }

  .mobile-card-table .mobile-table-card:hover {
    background: #fff;
  }

  .mobile-card-table .mobile-table-card td {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
    padding: 9px 0;
    border-bottom: 1px solid #edf0f4;
    color: var(--text);
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  .mobile-card-table .mobile-table-card td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
    line-height: 1.3;
  }

  .mobile-card-table .mobile-table-card .mobile-card-primary {
    grid-column: 1 / -1;
    padding: 12px 0 10px;
    color: var(--text);
    font-size: 14px;
    font-weight: 650;
  }

  .mobile-card-table .mobile-card-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    margin: 0 -13px;
    padding: 0;
    border: 0;
    border-top: 1px solid var(--line);
  }

  .mobile-card-table .mobile-card-actions::before {
    display: none;
  }

  .mobile-card-table .mobile-card-actions button,
  .mobile-card-table .mobile-card-actions a {
    min-width: 0;
    min-height: 42px;
    display: inline-flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    padding: 9px 5px;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: #fff;
    color: var(--blue);
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
  }

  .mobile-card-table .mobile-card-actions button:last-child,
  .mobile-card-table .mobile-card-actions a:last-child {
    border-right: 0;
  }

  .mobile-card-table .mobile-card-actions .danger-link {
    color: var(--red);
  }

  .mobile-card-table .mobile-table-empty {
    display: block !important;
    padding: 0;
    border: 1px dashed var(--line);
    border-radius: 11px;
    background: #fbfcfe;
    box-shadow: none;
  }

  .mobile-card-table .mobile-table-empty td {
    display: block !important;
    padding: 30px 14px;
    border: 0;
    text-align: center;
  }

  .mobile-card-table .mobile-table-empty td::before {
    display: none;
  }

  .task-card footer {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .task-card footer > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .task-card footer button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 340px) {
  .mobile-card-table .mobile-table-card {
    grid-template-columns: 1fr;
  }

  .mobile-card-table .mobile-table-card .mobile-card-primary,
  .mobile-card-table .mobile-card-actions {
    grid-column: 1;
  }
}
